Objectifier of Design Pattern
Intention
To make the object independent from other objects, you can easily modify the behavior and attributes of this object without affecting other objects.
Solution
1. Create an abstract class to define a common interface (abstract method) for specific mutable behaviors and attributes ).
2. Create a specific class inherited from the abstract class to implement specific behaviors and attributes.
3. Define a reference to an abstract object in the client program, and assign the specific class (ConcreteObjectA or ConcreteObjectB) to the reference during the program running.
4. The client calls specific behaviors and attributes through the client object reference (AbstractObject) to the ConcreteObject object.
Conclusion
L good behavior of encapsulating objects
L highly configurable and personalized design
L overhead is added because indirect object references exist.
Related Mode
Strategy and State