The Objectifier of design pattern
Intention
Making an object independent of other objects makes it easy to modify the behavior and properties of the object without affecting other objects.
Resolution Steps
1. Create an abstract class to define a common interface (abstract method) for specific mutable behaviors and attributes.
2. Create specific classes that inherit from an abstract class to implement specific behaviors and properties.
3. Define a reference to an abstract object in the client program that assigns the specific class (Concreteobjecta, or CONCRETEOBJECTB) to this reference at run time.
4, the invocation of the client to the specific behavior and attributes is delegated to the Concreteobject object by reference to the client object (Abstractobject).
Conclusion
L very good encapsulation of the behavior of the object
L height can be prepared and personalized design
l because there are indirect object references to increase overhead
Related mode
Strategy and State
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service