Model:
Application Scenario:
1, access to the portal is unified
2, the specific implementation of a variety of changes
Simulation Scenario:
1, the Cake Shop has a machine (interface) for making cakes, and the machine has a abrasive slot (defined inlet)
2, the machine needs to have different cake abrasives to shape (abstract class), abrasives and machines have a matching model (entrance realization)
3, the abrasive also stipulates the size of the cake, but the cake material is not fixed (the definition of differentiation)
4, nuts cake in the abrasive, put the nuts, egg cake in the mold into the eggs (differentiated implementation)
(1), the machine is an interface (2), abrasive is abstract class (3), abrasive + material is the concrete realization
Analytical:
The abstract class implements the uniform entrance to the interface, and constrains the definition of the concrete implementation class.
Interface + abstract class + implementation class three-tier design model