Big talk design mode The first chapter: Factory model Polite: The program can run is not necessarily optimal. Can be maintained, extensible, reusable, flexible, avoid duplication (can be more than one link to eliminate duplication) business logic and interface logic of the separate class and object abstract class, virtual method to implement different functions such as calling different functions, to use different classes, as long as a base class, using SWICTH to determine what function to use, You can then initialize the base class with subclasses. One of the most basic classes, inheritance allows all subclasses to have some kind of feature, and in order to implement some dispensable features, interfaces can be used. Principle: As far as possible to avoid duplication only separation can be better maintenance and reuse. To reuse, do not copy to loose coupling does not matter coupling UML diagram: One-way association with arrows, bidirectional not. +public-private#protected line plus blank triangle: inherited, arrow pointing to an inherited dashed line plus a white triangle: implemented, the arrow pointed to the implemented arrow: a class implementation of a class, class containing a class empty diamond plus arrows: aggregation, inclusion, in turn, Not the whole part, and the optional entity diamond plus arrows: synthesis, inclusion, the whole part, not separable, no, there will be numbers, such as a bird has 2 wings dashed arrows: dependence, people to rely on air, etc.
Liar design Mode 1.0.1-----Factory mode