Objectifier design pattern

xiaoxiao2021-03-06  43

Objectifier design pattern

Objectifier design pattern

intention

Make the object independently from other objects, which can easily modify the behavior and properties of this object without affecting other objects.

Solution step

1. Creating an abstract class as specific variable behavior and attribute defines a universal interface (abstract method). 2. Create a specific class that inherits from an abstract class to achieve specific behavior and properties. 3. Define a reference to an abstract object in the client program to assign the specific class (ConcreteObjecta, or ConcreteObjectb) at runtime. 4. Enter the ConcreteObject object to the CLIENT object to the CLIENT to delegate the CLIENT object with reference to a reference to a particular behavior and attribute. in conclusion

l Good tolerance of good packaging objects Limitable and personalized design L because there is an indirect object reference to increase overhead related modes

Strategy and State

转载请注明原文地址:https://www.9cbs.com/read-86859.html

New Post(0)