Abstract Factory - fruits and vegetables

Roles:

Abstract Factory role : as this is a core role model, he should be independent of commercial systems and applications. Usually a Java interface or Java abstract classes, other concrete factory class must implement this Java interface or inherit the Java abstract class.

Plant-specific role : This role is created directly in the call to the client's product instance, the role of logic products containing choose the right object, and this logic is closely related to the application of commercial logic.

Abstract Product Role : This role is the parent object created by the factory model, or their common interface.

Role of specific products : any product objects created by the abstract factory pattern is a specific instance of a product category. This is the final thing the client needs, which is filled with internal business logic.

FIG class structure:

 

Guess you like

Origin www.cnblogs.com/Damocless/p/12104362.html