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 閱讀(125) 評論(0)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 思南县| 绵阳市| 登封市| 广灵县| 天祝| 上高县| 和平区| 来凤县| 清原| 崇左市| 海口市| 曲水县| 左权县| 印江| 三河市| 右玉县| 康马县| 仁怀市| 永顺县| 益阳市| 丽水市| 花莲市| 公安县| 吉水县| 米泉市| 阳江市| 介休市| 桓台县| 灵武市| 蕲春县| 井陉县| 曲阜市| 大厂| 绥芬河市| 盐源县| 石泉县| 措勤县| 嫩江县| 二连浩特市| 虹口区| 莱州市|