Simple design principle in extreme programming

xiaoxiao2021-03-06  111

1. Consider the easiest thing to work The first job in the XP team is to achieve the first user needs in a simple manner as possible. Find as much as possible to achieve the easiest design of current user needs. When implementing the current user needs, if you can use a flat file, you don't use the database or EJB; if you can use a simple Socket connection, you will not use ORB or RMI; if you can use it if you can use it. 2. Suppose it will not need some infrastructure XP teams that may not start from the infrastructure, they may not first choose to use the database or middleware. At the beginning, it is assumed that those infrastructure will not be required. Only there is evidence, or at least very obvious signs indicate that it is now introduced more than a more cost effective than continuing to wait. 3. Eliminate duplicate code No matter where you find duplicate code, you should eliminate them. When those repeated code are found, they can be eliminated by defining a function or base class. Sometimes two or more algorithms are very similar, but there is a subtle difference between them, turn them into functions, or use the Template Method mode. The best way to eliminate repetition is abstraction. After all, if the two things are similar, there must be some abstraction to unify them. The elimination of repetition will force the team to extract many abstractions and further reduce the coupling between the code. The most important feature of simple design is easy to adapt to changes. To achieve such purposes, simple design should: can be simply understood. This relies on your code to understand. Only understand, the simplicity below can achieve. Simply modified and expanded. The OO system often changes or increases system behavior through incremental methods, so it is to be simply reused, which requires us to have no duplicate code. There are minimum number of classes. To read the system, then system Each class should correspond to every important concept of the problem that needs to be resolved. If manual joins many meaningful classes or too many problems cannot be corresponding, the system will not understand the minimum number of methods. Each one The method should have his independent meaning. If you don't have the name of the mind, then the system will be difficult to understand.

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

New Post(0)