Design Mode 0-getting started

Source: Internet
Author: User

Design Mode 0-getting started

When the code is too large, it will inevitably lead to maintenance difficulties if the design is poor and the layers are chaotic.
Ref
Ref

Emotion:
The task assigned to me by the senior engineer is to write the log system.
My step is to design the content to be written, and then get it directly in the simplest way.
Result:
1. The Code style is too bad (mainly hierarchical disorder)
2. Data Storage is messy. Some constant settings/configuration items are not written in the place or in the program code.
I deeply understand the importance of design!


Therefore, you must consider the following points during design:

To obtain data, you need to find out which layers of data can be used to obtain a function. at the interface level, you need to provide function modules for the data layer of upper-layer applications. Data storage. The Context is generally a set of Constants related to configuration items and program running (autoconfig configuration item injection or configuration settings in xml.

PS:
Some Understandings
1. Decoupling: reduce the mutual dependency between classes, similar to int a = B, rather than int a = 2;
Replace them with the intermediate quantity, which is equivalent to the same interface. In this way, B can be changed when we use.

 

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.