Code Quality scalability

Source: Internet
Author: User

<Span style = "font-weight: bold;"> scalability-changing user needs </span>

What remains unchanged in the world is change, and the demand for software will not change? Impossible! Whether a system embraces changes is determined by its maintainability and scalability. Changes in the software environment (may be the business environment or runtime environment) as a result, software must be modified to meet people's requirements. The ability of the system to adapt to changes is scalability.

Scalability has an impact on both system performance and complexity. projects with high complexity are difficult to maintain and test. I highly recommend foreseeable and simple expansion design, and the simpler the better, we can achieve our goal through continuous reconstruction to avoid a large number of designs in the early stage and unpredictable expansion in the later stage. Therefore, scalability is not achieved overnight. It needs to be reconstructed with your in-depth understanding of the business field. Generally, it can reach an ideal level three times.

The foresight of scalability is like buying a stock. If you buy a stock, you will benefit a lot. If you do not buy a stock, your code quality will be bloated and ruined. This will cause a lot of trouble for your future maintenance and development.

 

<Span style = "font-weight: bold;"> how to build a flexible system? </Span>

<Span style = "font-weight: bold;"> White Box scalability </span>

<Span style = "font-style: italic;"> open box scalability </span>

Meaning: You can view and modify the source code.

Means:

<Ul style = "direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in; "type =" disc "> <li style =" margin-top: 0; margin-bottom: 0; vertical-align: middle; "> <span> modify the code directly, there are not enough comments. You need to read a large piece of associated code to understand the meaning of the Code. The Code style is chaotic and is not licensed according to the standard. The code is related to other modules, you need to modify other modules before you can perform your work. </Span> </li> <li style = "margin-top: 0; margin-bottom: 0; vertical-align: middle;"> <span> modify the code directly, there are enough annotations, good code style, easy to read and understand, and the modification value is limited to a class or a module. </Span> </li> </ul> <span style = "font-style: italic;"> glass case scalability </span>

Meaning: You can view the source code, but cannot modify it.

Means:

<Ul style = "direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in; "type =" disc "> <li style =" margin-top: 0; margin-bottom: 0; vertical-align: middle; "> <span lang =" zh-cn "> introduce the source code project and </span> <span lang =" en-us "> jar </span> <span lang =" en-cn "> package, combine and encapsulate third-party class libraries </span> </li> <li style = "margin-top: 0; margin-bottom: 0; vertical-align: middle; "> <span lang =" zh-cn "> introduce the source code project and </span> <span lang =" en-us "> jar </span> <span lang =" en-cn "> package, use inheritance to write child classes and add new business logic to child classes </span> </li> </ul>

<Span style = "font-weight: bold;"> black box scalability </span>

<P style = "margin: 0in; font-size: 10.5pt;"> <span lang = "zh-cn"> meaning: extends existing systems without directly extending their original code, the source code is usually invisible and provides documents and conventions. In the black box, the result is true. </span> <span style = "font-family: calibri; "lang =" en-us "> ocp </span> <span lang =" zh-cn "> principles </span> <span lang =" zh-cn ">. </Span> means:

<Ul style = "direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in; "type =" disc "> <li style =" margin-top: 0; margin-bottom: 0; vertical-align: middle; "> <span> modify the configuration file, you need to re-read the configuration file to make it take effect. Generally, these configuration files store technical parameters or business logic. </Span> </li> <li style = "margin-top: 0; margin-bottom: 0; vertical-align: middle;"> <span> In the Configuration Wizard, for example, when a program is installed or initialized, the user's selection is stored on the hard disk, and these files are automatically read when the program starts. </Span> </li> <li style = "margin-top: 0; margin-bottom: 0; vertical-align: middle; "> <span lang =" zh-cn "> Dynamic Object assembly, using </span> <span lang = "en-us"> java </span> <span lang = "zh-cn"> reflection technology, load the class (</span> <span lang = "en-us"> class. forname </span> <span lang = "zh-cn"> ), </span> <span lang = "en-us"> </span> <span lang = "zh-cn"> </span> <span lang = "zh-cn"> dependency injection </span> <span lang = "zh-cn">, it also needs to be configured </span> <span lang = "en-us"> Bean </span> <span lang = "zh-cn"> file. </Span> </li> <li style = "margin-top: 0; margin-bottom: 0; vertical-align: middle; "> <span> the module-based dynamic extension during runtime. All the above mentioned methods are just fine-grained technical extension methods, and the new functions can take effect only by re-compiling the project, all of them have not reached the module-level extension. Osgi can achieve dynamic expansion at the module level and is running. The so-called dynamic extension of runtime modules means that you can organize newly developed classes and files according to bundle and directly throw them to the runtime environment. These functions can be used. The eclipse plug-in architecture is built with equinox (an osgi standard implementation) as the core. </Span> </li> <li style = "margin-top: 0; margin-bottom: 0; vertical-align: middle; "> <span lang =" zh-cn "> Based on the platform, developers are allowed to expand on their own. The platform and framework usually define some hot spots, can be expanded, such as </span> <span style = "font-family: calibri; font-size: 10.5pt; "lang =" en-us "> window </span> <span lang =" zh-cn "> provides thousands of </span> <span style =" font-family: calibri; font-size: 10.5pt; "lang =" en-us "> api </span> <span lang =" zh-cn "> application calls, </span> <span style =" Font-family: calibri; font-size: 10.5pt; "lang =" en-us "> firefox </span> <span lang =" zh-cn ">, </span> <span style =" font-family: calibri; font-size: 10.5pt; "lang =" en-us "> chrome </span> <span lang =" zh-cn "> plug-in, and various application platforms (</span> <span style = "font-family: calibri; font-size: 10.5pt; "lang =" en-us "> facebook </span> <span lang =" zh-cn ">, </span> <span style =" font-family: calibri; font-size: 10.5pt; "lang =" en-us "> taobao </Span> <span lang = "zh-cn">). Most of them are extended using intermediate languages. The specific technical details are unclear. </Span> </li> </ul>

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.