Once the procedure is found to be unsatisfactory, it must be reconstructed.

Source: Internet
Author: User

In the morning, wrote a "design mode-builder" mode http://www.cnblogs.com/insus/p/4179620.html. is in an ASP. NET environment, application and presentation design pattern (Builder). Now insus.net Download the source program from the last download link of blog post, it is not written well enough, now refactor it.

Problem point, the page has only one placeholder container, not all the generated parts are generated in a container, but for positioning, placed in several places, there can be left or may be right. The ID of the Placeholader will vary depending on the Web page.
Another problem, the part name _pageparts["header"],_pageparts["Content"],_pageparts["footer"] and so on. It appears in two categories at the time of development. It can be misspelled if you write it up.

In response to these two big questions, Insus.net decided to refactor the programs. Unified Part Name:



Refactoring Webpage class:

Refactoring Concrete class Newspages:



The same technique for refactoring concrete class Articlepages:

Xxx.aspx.cs:



And:


In the future, we can develop user controls and Web pages. Some classes do not need to make more changes. Dynamic loading and easy maintenance are achieved.

SOURCE program:
Http://download.cnblogs.com/insus/Refactoring/builder_refactoring.rar

Once the procedure is found to be unsatisfactory, it must be reconstructed.

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.