afunms

          My Software,My Dream—Forge a more perfect NMS product.

          builder 4 report

          Completed LinkReport.There are two questions should be improved in the
          next version.
            The first,the relevant DAO classes filled with repetitious code.I consider to
          reconstruct these DAOs.
            The second,suddenly I am aware that Builder Pattern is the best way to
          solve the complex problem of creating a report.

            The code likely be following:
            ReportBuilder builder = new ReportBuilder();
            Director director = new Director( builder );
            director.construct();
            Report report = builder.createReport();

          -----------------Builder Pattern------------

          The Builder pattern allows a client object to construct a complex object by specifying only its
          type and content.The client
          is shielded from the details of the object's construction.

          It is a pattern for step-by-step creation of a complex object so that the same construction process
          can create different
          representations is the routine in the builder pattern that also makes for finer
          control over the construction process. All
          the different builders generally inherit from an abstract
          builder class that declares the general functions to be used by the
          director to let the builder create
          the product in parts.

          Builder has a similar motivation to the abstract factory but, whereas in that pattern, the client uses
          the abstract factory
          class methods to create its own object, in Builder the client instructs the builder
          class on how to create the object and
          then asks it for the result. How the class is put together is up
          to the Builder class. It's a subtle difference.

          The Builder pattern is applicable when the algorithm for creating a complex object should be
          independent of the parts that
          make up the object and how they are assembled and the construction
          process must allow different representations for the
          object that is constructed.

          posted on 2008-01-14 22:25 afunms 閱讀(134) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           

          My Links

          News

          留言簿(18)

          隨筆檔案

          相冊

          搜索

          最新評論

          閱讀排行榜

          主站蜘蛛池模板: 虞城县| 中牟县| 巴青县| 桃源县| 宝兴县| 红安县| 永嘉县| 剑阁县| 亚东县| 德安县| 屏东市| 海安县| 彰武县| 阳泉市| 临沭县| 涞源县| 黄大仙区| 固原市| 白银市| 台南市| 文昌市| 清流县| 赤城县| 沙洋县| 溧水县| 余庆县| 呼伦贝尔市| 清河县| 台江县| 北票市| 荆州市| 华池县| 如皋市| 岳阳市| 福贡县| 博乐市| 阜南县| 余江县| 南昌县| 崇明县| 南汇区|