With a life examples to illustrate design principles

With life examples to illustrate design principles. Do you want to challenge

 

Suppose you have developed a Tetris, if you write all inside a main method, he will be very difficult to maintain, but you can move a single basic principle, the page rendering logic and separated Tetris, then you have One

Highly portable program, you can migrate directly from pc to andori, low cost, this is the benefits of single responsibility.

 

You will fix the computer what you will when less than you memory replacement memory what, why various manufacturers cpu can be you use, and why computers are so complicated stuff, but you can make simple repairs, while smaller and more small radio you will not do,

Because between the various computer makers, are produced by contract interface to students of their own equipment, so we have to comply with the main device with an interface that can be agreed upon production mix, which is oriented programming interface, or call the benefits of the Dependency Inversion

 

Also the computer, assuming that we have insufficient memory, you want to add some memory, there are a variety of ways, may be directly on your content into the 8G 16G, but you may find that your computer can plug in another one memory into 8 + 8 way, why you can add

Because computer manufacturers found that many people will have to play this kind of demand, thus providing it encapsulates the expansion interface, rather than demolition machine manufacturers, crunching into the 16G, which is the benefits of opening and closing the principle that you have such needs, then I good package in advance, so that you do not need to dismantle the computer, you

Can expand the memory you want is respect.

 

That so many of the principles we have been using so well in life, why we are not programmed, the little transplant and let our program too complex even with the computer simple, flexible, and you can also include you think application design principles of life.

 

Guess you like

Origin www.cnblogs.com/wangchaodong/p/11973761.html