XP design principle

xiaoxiao2021-03-06  125

XP design principle

BrokenDoor (XPCHINA) September 15, 2003

1 Simple is a key simple design that always spends less time to complete complex tasks. Therefore, remember that you should always do the simplest thing that is possible. If you find a matter, it is very complicated, replaced it with simple things. Instead of consuming more time on complex code, it is better to replace simple code, so faster, and more troublesome. As much as possible, make things happen, do not add new features as much as possible during the implementation plan. Keep in mind that a simple design is working for a long time.

2 Selecting the system metaphor Select system to provide a consistent picture to the team by a consistent naming of classes and methods. Your object name is very important for the understanding of the overall design of the system and code reuse. If you can take a name, make it easy to guess, and it's right, then you are a person who can save time. Choosing a method involving a wide object name without detail, it is difficult to get awareness of the system. For example, the Chrysler's salary payment system is built as a production line. The Ford car sales system is constructed as a list of materials. Use the beautiful metaphor based on your own field to make it know. However, unless it is quite simple, don't choose a beautiful metaphor.

3 CRC cards use CRC (Class, Responsibilities, Collaboration) cards as a team design. The biggest value of the CRC card is to allow people to detach from thinking process patterns, more fully focused on object technology. The CRC card allows the entire project team to contribute to design. The more people involved in the system design, the more good ideas that can be collected. Individual CRC cards are used to describe objects. The class of objects is written on the top of the card, and the responsibility is edited under the left side, and the right side of each responsibility is a collaborative class list. Because the previous CRC meeting is everyone's efforts to participate, usually only requires a small number of cards, but did not write a complete card, so we said, "Write". This example shows part of the coffee maker problem. The CRC meeting continues, some people simulate the system and object exchange, pass the message to other objects. The problem is easily resolved by step by step by step. Design selection can make decisions quickly by doing recommended simulation experiments. If you find that many people are talking and moving cards, simply limit the number of people standing, move the card to the next person. Other people can stand up when one is in a person. Free discussion of this work, often happening, as a difficult problem is finally answered, the development group becomes noisy. One of the biggest criticisms received by the CRC card is the lack of recorded design. The CRC card makes the design look obvious, so this is usually not required. Permanent records should be required, each class is a card, each card as a document detailed record and retained. Once the expectations have been established and run, the design is remembered for a while.

4 Nail Solutions To make a solution to techniques or designs, produce a staple solution. The staple solution is a very simple program exploring potential solutions. Constructing a system, only focusing on the problems that appear, ignoring that most of the other opposes are not sufficient, so it is intended to throw it away. The goal of using the staple is to reduce the risk of technical issues, or increase the reliability of user story assessment. When technical difficulties hinder system development, a pair of developers are equipped on this problem, giving a week or two weeks to reduce potential dangers.

5 Don't increase the function of the system prematurely to keep your system, add additional materials you guess. Only 10% of the extra material is used, so you are a waste of 90%. Because we understand how to increase, or we want to make the system better, we are both tempting to increase the function instead of future. Now add functions, it seems faster. However, we need often remind yourself: in fact, we don't need it. Additional features will always develop slow, and waste our resources. Put your eyes in the future demand and additional adaptability. Only focus on today's progress. 6 Timely re-constructing the software changes in the software for a long time, our computer programmer still maintains the design. We continue to use and reuse the code for a long time without maintenance, because in some way, we can continue to modify it. But do you really worth this? Extreme Programming (XP) is not the case. When we remove redundancy, delete unused features, we update the old design, we re-construct (refactor). Save time throughout the entire project lifecycle, guarantees quality. In order to maintain the design, avoid unnecessary confusion and complex, timely reconstruction. Keep the code's simple, clear so it makes it easier to understand, modify and expand. Confirm that everything is represented once, and only once. As a result, there is less time to produce a better system. Reconstruct a few points. First of all, it is difficult because you must be able to let go of the perfect design you imagine, accept the design of you through reconstruction. You must realize that your imagination is just a good direction direction, and it will actually become old. In order to eat a lot of leaves, caterpillar is a perfect design, but it can't find a spouse, it must turn itself into a butterfly before planning to find it. Give up what the system should be or not what the idea is, try to pay attention to the new design in front of you.

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

New Post(0)