Study design mode Note 1

Source: Internet
Author: User

In the past, I only had a rough understanding of the design pattern, but not many of them were actually used,
Now it's time for the system to learn about the design model,
This is the next higher level after the object-oriented knowledge!
For designing a software system, if object-oriented is the weapon of design, then the design mode is the weapon of use!
A software system using an appropriate design model has good reusability, scalability, and maintainability!

Benefits of learning Design Patterns:
Master reusable and high-quality solutions;
Facilitate internal communication between teams;
Analyze and solve problems from a higher perspective;
Judge whether there is a correct design, not just a workable design;
ImprovementCodeCan be modified;
Promote the selection of improved designs, even when the design model is not explicitly used;
Find an alternative to the "huge inheritance system.

 

Facade appearance Mode, Usage reason:
Some features of a complex system can be encapsulated to simplify its use.
Hides a system and does not directly expose it to users.
Tracking the use of a system
Changing the functions of a system on the original basis
Write a new simple and easy-to-use system, so that everyone can learn a complex system.
For example, a dummies camera automatically adjusts various parameters in one-click photo packaging,
The new operation encapsulates operations such as memory application and object initialization,
The new operator trace object is reloaded to detect memory leakage.

 

Adapter Mode, Usage reason:
Change the existing object interface to another interface to facilitate the use of other classes.
Adds the existing object interface function to upgrade the existing object to facilitate the use of other classes.
Example: power transformers and simultaneous interpretation.

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.