Several important principles of good design

1. Consistency principle: It is applicable to various design scenarios. For example, the operating system and software version in the system architecture design must be consistent, which is convenient for management and automatic deployment. Imagine if your company uses various operating systems and various service versions Inconsistent, God knows how to manage these servers. In code design, the code style, comment style, file encoding, etc. must be consistent. The code style you designed yourself is inconsistent. Think about how you can still read your own code in a few months? The software design should also be consistent. When you make a website, some pages are loaded by ajax, and some are loaded directly. When the user refreshes, they will sometimes jump to this and sometimes jump to that. The experience is very poor, and the code when implemented Not easy to reuse. The art design should also be consistent. The whole theme is blue, and suddenly there is a red color, which is too damaging to a harmonious society... In short, everything must follow the principle of consistency. Excellent consistent design, such as hadoop series, hadoop, hive, pig, sqoop, etc. have the same directory structure, and the configuration method is the same, so that users can configure it very easily. This is the highest state of consistency.


2. The principle of simplicity:
the design of anything should be as simple as possible. Clothing, websites, programs, architectures... should not be over-designed. Junior staff always feel that only complex designs can reflect their talents. The real master may be already Tired of designing complicated things so they designed simple things. The more complex the system, the more likely it is to introduce bugs and run more slowly, so always wonder if there is an easier way to pursue good design.


3. Hierarchical principle:
modular, object-oriented, MVC, cloud computing, in fact, the essence is nothing more than layering, and good layers are divided to facilitate management, maintenance, and human understanding. The advantage is flexibility and reuse. After the layers are separated, each layer can be flexibly combined and a layer can be reused. For example, the cloud is very popular now. In the past, the server and the platform were soft together. The cloud separated them. The server is called the IaaS layer, and the platform is called the PaaS layer, so that when we want to use the database, we don’t have to go to the IaaS layer to get it. Now, you don't need to worry about which server it is installed on, and you don't need to configure the cluster yourself, because that time has been abstracted.


4. The principle of openness:
Not only the source code should be open, but the design should also be open. There is no need to design anything to be fixed and immutable. The world is always changing, and nothing is constant. All designs must consider future expansion and changes. The problem with closed source is that he feels that his code will not change or that others cannot change it.


Any good design can't run out of these principles. If you don't believe me, think about spring, linux, cloud, mvc, ...

{{o.name}}
{{m.name}}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324117484&siteId=291194637