این موضوع، عنوان مقالهای از مارتین فاولر به سال 2004 است. مشغول بررسی مطلبی بودم که آن را مجدداً خواندم. در اصل این مقاله همان طور که خود فاولر ذکر کرده، به بررسی نقدی که به روس اکس-پی وارد شده پرداخته است. هر چند که این بررسی بسیار آموزنده و مفید است، اما بخش اول آن که بررسی دو روش طراحی برنامهریزی شده و طراحی تکاملی میپردازد، نکات ظریفی را بیان داشته که هر روز با آن مواجه هستیم و حتی هر یک از ما برای دوری از آن، روشهایی نیز به تجربه برای خود تبیین کردهایم. به لحاظ اهمیت این نکات، بخش اول مقاله را به همان صورت در زیر آورده و آدرس مقاله را نیز در ادامه ذکر کردهام.
Planned and Evolutionary Design
For this paper I’m going to describe two styles how design is done in software development. Perhaps the most common is evolutionary design. Essentially evolutionary design means that the design of the system grows as the system is implemented. Design is part of the programming processes and as the program evolves the design changes.
In its common usage, evolutionary design is a disaster. The design ends up being the aggregation of a bunch of ad-hoc tactical decisions, each of which makes the code harder to alter. In many ways you might argue this is no design, certainly it usually leads to a poor design. As Kent puts it, design is there to enable you to keep changing the software easily in the long term. As design deteriorates, so does your ability to make changes effectively. You have the state of software entropy, over time the design gets worse and worse. Not only does this make the software harder to change, it also makes bugs both easier to breed and harder to find and safely kill. This is the “code and fix” nightmare, where the bugs become exponentially more expensive to fix as the project goes on.
Planned Design is a counter to this, and contains a notion born from other branches of engineering. If you want to build a doghouse, you can just get some wood together and get a rough shape. However if you want to build a skyscraper, you can’t work that way – it’ll just collapse before you even get half way up. So you begin with engineering drawings, done in an engineering office like the one my wife works at in downtown Boston. As she does the design she figures out all the issues, partly by mathematical analysis, but mostly by using building codes. Building codes are rules about how you design structures based on experience of what works (and some underlying math). Once the design is done, then her engineering company can hand the design off to another company that builds it.
Planned design in software should work the same way. Designers think out the big issues in advance. They don’t need to write code because they aren’t building the software, they are designing it. So they can use a design technique like the UML that gets away from some of the details of programming and allows the designers to work at a more abstract level. Once the design is done they can hand it off to a separate group (or even a separate company) to build. Since the designers are thinking on a larger scale, they can avoid the series of tactical decisions that lead to software entropy. The programmers can follow the direction of the design and, providing they follow the design, have a well built system
Now the planned design approach has been around since the 70s, and lots of people have used it. It is better in many ways than code and fix evolutionary design. But it has some faults. The first fault is that it’s impossible to think through all the issues that you need to deal with when you are programming. So it’s inevitable that when programming you will find things that question the design. However if the designers are done, moved onto another project, what happens? The programmers start coding around the design and entropy sets in. Even if the designer isn’t gone, it takes time to sort out the design issues, change the drawings, and then alter the code. There’s usually a quicker fix and time pressure. Hence entropy (again).
Furthermore there’s often a cultural problem. Designers are made designers due to skill and experience, but they are so busy working on designs they don’t get much time to code any more. However the tools and materials of software development change at a rapid rate. When you no longer code not just can you miss out on changes that occur with this technological flux, you also lose the respect of those who do code.
This tension between builders and designers happens in building too, but it’s more intense in software. It’s intense because there is a key difference. In building there is a clearer division in skills between those who design and those who build, but in software that’s less the case. Any programmer working in high design environments needs to be very skilled. Skilled enough to question the designer’s designs, especially when the designer is less knowledgeable about the day to day realities of the development platform.
Now these issues could be fixed. Maybe we can deal with the human tension. Maybe we can get designers skillful enough to deal with most issues and have a process disciplined enough to change the drawings. There’s still another problem: changing requirements. Changing requirements are the number one big issue that causes headaches in software projects that I run into.
One way to deal with changing requirements is to build flexibility into the design so that you can easily change it as the requirements change. However this requires insight into what kind of changes you expect. A design can be planned to deal with areas of volatility, but while that will help for foreseen requirements changes, it won’t help (and can hurt) for unforeseen changes. So you have to understand the requirements well enough to separate the volatile areas, and my observation is that this is very hard.
Now some of these requirements problems are due to not understanding requirements clearly enough. So a lot of people focus on requirements engineering processes to get better requirements in the hope that this will prevent the need to change the design later on. But even this direction is one that may not lead to a cure. Many unforeseen requirements changes occur due to changes in the business. Those can’t be prevented, however careful your requirements engineering process.
So all this makes planned design sound impossible. Certainly they are big challenges. But I’m not inclined to claim that planned design is worse than evolutionary design as it is most commonly practiced in a “code and fix” manner. Indeed I prefer planned design to “code and fix”. However I’m aware of the problems of planned design and am seeking a new direction.
She said that she usually cried at least once each day not because she was sad but because the world was so beautiful and life was so short.
Brian Andreas – Reference: Booch Blog