Connect to:
http://www.9cbs.net/develop/read_article.asp?id=11801
Using the Builder mode, you can avoid the shortcomings of Abstract Factory's goal, because Builder produces the product difference, so that there is no need to define an abstract parent class, and many people will put Builder and Observer is mixed, thinking that Subject is Director, Observer is Builder, in fact, Director in Builder mode is virtual, do not include, actually just uniform in Builder, can be seen as a Director interface. There are several benefits to use Builder mode: 1. You can change the ways and processes of the goal, only use new builder (a team member of a tactic). 2. Separate the process of goals and other tissue processes. 3. Can be more refined with the goal process. 4. The abstract parent class of Builder does not declare the generation method into a pure virtual function, but defines a cost-space method that allows the coach to only define the methods they need. The code is as follows: Class Time Machine {public: Virtual Void header () {} Virtual void foot shoot () {} Virtual void other shoot () {}
Virtual goals * get goal () {return 0;} protected: tap machine ();
Class players: public tap machine {public: player ();
Virtual void header (); Virtual void foot shot (); Virtual void other shoot ();
Virtual goals * get goal ();
PRIVATE: / * ... 自己 自己 特 特 和 和 方式 方式 方式 方式 方式;