Thoughts on the design model (postscript)

Source: Internet
Author: User

In the previous article, I talked about the benefits and actual application scenarios of the factory method for HTML element output. Here I will honor it:
1) you can attach many responsibilities. This is an advantage of many design models.

Constructor design modes such as factory methods are also a major advantage. Typical application scenarios:

A) Check the legitimacy of Enterprise Development: using the method provided by Microsoft or the 3rd-party method is also a good choice, but for a more flexible design approach, putting verification information in a class or database is actually a better choice. In this way, the factory method is used to output HTML elements. Although HTML elements need to be spliced, the benefits are very high, the validation rules can be implemented in a unified manner, and the Implementation can be delayed;

B) multi-language processing: If the processing is based on the traditional multi-language provided by Microsoft, it is difficult and inflexible in the cloud environment and cannot be processed in some places, such as the multi-language of dictionary data, if the multi-language data warehouse is implemented, and the control output is followed by a certain rule to handle the multi-language responsibility, it is very simple and flexible.

Of course, with this idea of attaching responsibility, many functions can be implemented in this factory method, such as form element display control and form button permission control.

However, using this method also has its own shortcomings. First, when there are too many responsibilities attached, this mechanism will be large and complex. Second, it willProgramMembers have lost a lot of fun and are not so pure at the same time.

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.