Reading Notes, Reading Notes

Source: Internet
Author: User

Reading Notes, Reading Notes

The design pattern allows you to share words with other developers. The design pattern can increase the level of your thinking architecture to the pattern level, rather than staying on trivial objects.

 

Design principles:

  • Encapsulate changes: Identify potential changes in the application and separate them from those that do not need to be changed.
  • Multi-Purpose Combination and less inheritance: users can build systems with great flexibility. They can not only encapsulate the algorithm family into classes, but also dynamically change behavior during runtime, as long as the combined behavior object meets the correct interface standards.
  • For interface programming, it is not for implementation programming: The interface mentioned here is not just for the interface, but for the super type, it can be understood as "for the super type programming ", the key to this is polymorphism.

 

The policy mode defines the algorithm family and encapsulates them separately so that they can be replaced with each other. This mode makes the algorithm changes independent of the customers who use the algorithm.

The observer mode defines one-to-multiple dependencies between objects. In this way, when an object changes its state, all its dependent persons will receive notifications and update them automatically.

Related Article

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.