A fate of an OO design

zhaozj2021-02-17  54

The following is a little thinking and experience when I use the object-oriented approach, and some will be a bit free, and the opinions containing the views may be lost, welcome to visit more.

When designing the object-oriented (oo) thought, a good design is often derived from some simple motivations: hiding some things of the object, not being seen by the outside, and the few objects are valid. Make the coupling degree, define the responsibility of an object, let it do what it should do, .... They exist in the subconsciousness of the designer and play a role.

And when you try to implement these good wishes into your design until the end of the code, it will often encounter such difficulties. This makes you have to adjust your original intention or insist, or change, or completely replace the ideas. This process is often repeated. When you find a solution solution, you will be excited for your own idea, and after the design is modified, when the new problem occurs, you have to reach the painful meditation. In this period of being tortured, joy and pain coexist, maybe oo design is here. In the end, this will be an exciting thing when your design is clearly fixed and realized by the code.

But things may have not ended yet, with the update of the product, the changes in user needs, your design is suffering from a serious test. Perhaps every time, you will make amendments to your design to adapt to these changes. But it is also the accumulation of this correction, causing you at a little bit of the original idea of ​​perfect design. This is a bit like a rock that is hitting the waves. Unfortunately, when you start to realize this, it may be too late. The pressure from the customer makes you slightly rush and slightly when you design it. This makes your original masterpiece zhemism, you suddenly found that the latest design is far from the original one. The earlier motives, those simple motives, in your latest design, is not so clarified. Now you may have taken care of the beautiful ideas, simple solution, what you can do is trying to make up. This is a malignant cycle, and its pain is gradually increasing until finally, you are exhausted from that circle. Your design is probably only two results: either by you ruthlessly abandoned because it has not continued to modify the value; either continuing to delay, and turn the task of maintaining its task to others.

This is the fate of an OO design.

转载请注明原文地址:https://www.9cbs.com/read-29165.html

New Post(0)