Great software is not built, it is grown
Thursday, June 18th, 2009作為一個架構師,主要任務是提供了初部結構和安排不段增長和隨著時間而改變的軟件系統,而且幾乎總是在你和利益相關者沒有預見下重做,或者和其他系統溝通。儘管我們是所謂的架構師,我們由建築和工程方面借用了許多隱喻,但偉大的軟件不是建造,而係成長出來的。
唯一最大既避免軟件失敗係軟件規模;由大型系統開始設計幾乎沒有任何好處。然而,在某個時候我們都將受到誘惑而這樣做。除了作為容易附帶的複雜性和慣性,設計大型系統的前期意味著更大的項目,這些項目更有可能失敗,更可能是無法測試,更可能是脆弱的,更可能有不必要的和不使用的部分,更可能是昂貴的,而且更有可能產生不利因素。
因此要抗拒試圖設計一個大型完整的系統,無論是多麼誘人,以“達到或超過”已知的要求和期望的特性。已經是一個宏大的目標,但不一定是一個大的設計。令你同你的系統學習適應環境及不可避免的改變。
如何做到這一點?最佳的途徑係從一開始確保軟件系統可以成長和適應不斷發展。誘導系統成長代表從一個較小的系統運行,做一部分架構既工作 – 做最簡單而最有可能完成的部份。這初生的的系統將有很多可取的性能和能教育我們了解更多大型系統的架構,或者更糟的一堆架構文件。你更有可能參與了其實現方法。而細小的介面將可更輕鬆地進行測試,因此不容易耦合。這只需要一個較小的團隊,間接降低協調項目的成本。而且其特性將會更容易被觀察,更輕鬆地部署。它會教你和你的團隊在最早的時刻知道什麼做到和什麼做不到。它會告訴你的系統不會容易發展、有可能是堅固、或者係脆弱、又或者有可能被破解。也許最重要的是可以從一開始給予利益相關者一些理解和確實的情況,使他們能夠為整體設計成長。
設計最小的系統,您可以幫助實現它,並讓它朝著宏偉構想。雖然這可能會覺得自己放棄了控制,甚至推卸的責任,最終您的利益相關者將會向你表示感謝。不要混淆循序漸進的辦法與不理要求,可怕的逐步,或建設一個將會扔掉的系統。
##############################################
As an architect you are tasked with providing the initial structure and arrangement of software systems that will grow and change over time, will have be to reworked, will have to talk to other systems, and almost always in ways you and your stakeholders did not foresee. Even though we are called architects, and we borrow many metaphors from building and engineering, great software is not built, it is grown.
The single biggest predictor of software failure is size; on reflection there’s almost no benefit to be had from starting with a large system design. Yet at some point we will all be tempted to do exactly that. As well as being prone to incidental complexity and inertia, designing large systems upfront means larger projects, which are more likely to fail, more likely to be un-testable, more likely to be fragile, more likely to have unneeded and unused parts, more likely to be expensive, and more likely to have a negative political dimension.
Therefore resist trying to design a large complete system to “meet or exceed” the known requirements and desired properties, no matter how tempting that might be. Have a grand vision, but not a grand design. Let you and your system learn to adapt as the situation and requirements inevitably change.
How to do this? The best way to ensure a software system can evolve and adapt is to evolve and adapt it from the very outset. Inducing a system to evolve means starting with a small running system, a working subset of the intended architecture – the simplest thing that could possibly work. This nascent system will have many desirable properties and can teach us much about the architecture that a large system, or worse, a collection of architectural documents never can. You are more likely to have been involved in its implementation. Its lack of surface area will be easier to test and therefore less prone to coupling. It will require a smaller team, which will reduce the cost of coordinating the project. Its properties will be easier to observe. It will be easier to deploy. It will teach you and your team at the earliest possible moment what does and does not work. It will tell you where the system will not evolve easily, where it is likely to crystallize, where it is fragile. Where it might break. Perhaps most important, it will be comprehensible and tangible to its stakeholders from the beginning, allowing them to grow into the overall design as well.
Design the smallest system you can, help deliver it, and let it evolve towards the grand vision. Although this might feel like giving up control, or even shirking your responsibilities, ultimately your stakeholders will thank you for it. Do not confuse an evolutionary approach with throwing requirements out, the dreaded phasing, or building one to throw away.
by Bill de hÓra (edited by RMH Sept. 26, 2008) in 97 Things Every Software Architect Should Know
This work is licensed under a Creative Commons Attribution 3
