posts - 37,comments - 7,trackbacks - 0
          A factory method handles object creation and encapsulates it in a subclass. This decouples the client code in the superclass from the object creation code in the subclass.
          1. A factory method is abstract so the subclasses are counted on to handle object creation.
          2. A factory method returns a Product that is typically used within methods defined in the superclass.
          3. A factory method isolates the client from knowing what kind of concrete Product is actually created.
          4. A factory method may be parameterized(or not) to select among several variations of a product.
          posted on 2005-08-11 16:02 Dave 閱讀(124) 評論(0)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 黄冈市| 电白县| 东平县| 海安县| 濉溪县| 巫溪县| 定远县| 前郭尔| 盐山县| 兖州市| 沾益县| 图木舒克市| 武定县| 贵定县| 隆德县| 锦屏县| 永仁县| 永寿县| 永登县| 察哈| 景东| 宜良县| 濉溪县| 乌兰县| 乐山市| 安徽省| 敦煌市| 沙洋县| 常州市| 商洛市| 东安县| 怀安县| 兴安县| 寿阳县| 武强县| 泰安市| 嘉禾县| 延川县| 赤城县| 栾城县| 辽中县|