Objectifier of Design Pattern

Source: Internet
Author: User

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

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.