The code of good design and organizational structure

Excellent design and organizational structure of the code of
a same logic code in two or several times with, we must consider the possibility to extract the one carried out under the unified;
a function of variables exist, we must consider whether support future extensions, the changed and unchanged drawn isolation, to try to change the configuration of the can;
a block of code is executed once, then we must consider whether to execute at startup;
an instance to create one, then we must consider whether you want to start created directly by singleton in advance;
as long as there is network calls, you must set a timeout, you can quickly return to when such an exception, to ensure that basic services are available, or bullying;
if the function is the development of a tool (that is to say in accordance with tools positioned to develop, then it is easy to know what is the point of change, it is necessary to design the parameters of the idea of the place changed and unchanged quarantined)

Guess you like

Origin www.cnblogs.com/big1987/p/11028658.html
Recommended