Business Module Design Principles

Source: Internet
Author: User

The following is a summary of the work. The context is the design environment of the relational database. Please share your thoughts with me.

1. The minimum unit of the module is designed based on a complete transaction.

2. The minimum unit of the module is designed according to a complete process.

3. In the module, only the database connection can be applied and the database connection cannot be modified. It is best to obtain the database connection in the new method.

4. In the business moduleAlgorithmIf there is any adjustment, modify the business module directly, instead of using the inheritance method, and implement the modification in the subclass. The reason for this is that the business module cannot be a public module, it is used in several versions of the system at the same time. If it can be used at the same time, the business module must be the same business module. This also requires that when designing a system, the business module and functional modules in the system cannot be compiled together.

5. How member variable is used in the class.
After years of experience, it is found that the introduction of member variable into the method reducesProgramCoupling Degree. Although member variable can still be used in class methods, the consequence of direct use is thatCodeCannot be used directly.

# C # column

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.