Archive for June, 2009

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

Software Engineering ≠ Computer Science

Monday, June 15th, 2009

前幾日經 CodeProject 入面既 Email Subscription 介紹, 睇左個 Post 講呢個 Topic, 感覺幾好!!~~

簡單 d 講就似 Pure Math 同 Apply Math 既分別, Computer Science 主要係研究新科技, 但新科技往往都要經過人來善用, Software Engineering 係包括人既活動. 雖然 Engineering 既原則係想個個人跟住同一套次序, 所做既野都應該差唔多, 但因為個個人唔同, 每個人用唔同心態去做同一樣野都會有好大分別, 所以一組人用一種方法獲得成功, 未必能在另一組人用同一個方法成功, 所以只會用一些 “通常” 等等既字眼, Methodology 係咁, Architecture 係咁, 所以先會有 Design Pattern, Anti-Pattern 等等不同技巧既出現, 所以科技係要被正確使用才可以為公司帶來利益, 而何謂正確只能基於使用者對科技既認識, 經驗同思維上.

對我黎講, Computer Science 有些似由零變一既過程, 而 Software Engineering 就係將一變做二, 三, 四, 五等既進步, 而且 Software Engineering 注重既係每個方面都要求質素管理, 咁先有進步, 及可以容易地發現邊個 Process 有問題而提出改善, 但因為人既不同, 質素往往都存在在實行者既身上, 如果實行者跟得唔足, 質素未必一致, 跟得太跟, 效率未必做得好, 始終 agile 所講既 velocity 都要等到組員成熟先會提升到, 因此軟件既優劣在於實行既人對軟件質素認識同堅持.

而自己最低限度既堅持, 只在於 Coding Standard 既使用, 因為對外行人黎講, Naming Convertion 係最簡單可以由表面上睇到既野, 正所謂人靠衣裝, 如果 Source Code 給予人既外觀都不好既話, 使用程度只會慢慢減低, 跟住就唔會再得到重用, 慢慢形成 Anti-Pattern 中既 Lava Flow, 而且 Naming 本身亦係一個好重要既 Topic, 可以增加 Source Code 既可讀性, 因此自己對呢方面好注重. 另外, 自己雖然比較想用 OOD, 但自己亦唔會將所有野變成 OO, 以自己常用真實物件來代入設計軟件既態度上, 現實上有些東西係唔可以用 OO 係解決, 印象中好似係 Study Semantic Web 既過程入面, Rule Base 同某部份 Knowledge Base 既邏輯如果代成 Object 唔一定係好, 用 Routine Base 可能會較好.

Software Developer, 某程度上除左對 Computer Science 要有一定既認識, 亦都好應該對 Software Engineering 有所既認識, 因為自己係寫軟件, 如果質素做得不好, 科技用不得其所既話, 就可能會做成反效果!!

頹廢……你會接受嗎?

Thursday, June 11th, 2009

頹廢…近期成日聽到呢字, 事源係同事為了盡快為 Project 起貨而忽略重要既質量管理, 簡單來說就是為了快而形成了 Anti-Pattern 入面既 Stovepipe system, 感覺上係極差, 但可能因為自己無能力一個人做晒所有野, 所以只有開一個 Project 比佢自由地寫, 往後有時間再處理吧.

近期係公司開始了很多員工層既行動, 例如訂立 Coding Standard, 使用 Version Control 等, 呢d 係 IT 公司入面基本上係最基本既野, 但係呢度既員工大部份都無理, Coding Standard 其實有經驗既最少可以跟 MS 果個 (e.g. Prefix “I” in interface, Upper Case for Method, Properties Name, etc); 而 Version Control Server 有係度但有用既員工係我提出意見前黎講相信一半都無. 如果經過 Root Cause Analysis 黎講, 無 Coding Standard 係因為上層無指示, 而下層既人又唔想咁麻煩而無 Apply, 而 Version Control 就因為仲用緊 SourceSafe 6.0, 員工使用介面仲以 Visual Studio 6 既不良介面經驗黎做, 再加上有部份員工要外出工作, 所以會因為麻煩而唔去做好.

香港, 係一個注重質素既城市. 身為香港人, 如果再沉淪在頹廢既環境, 再不注重質素既話, 那本身既競爭力分分鐘連國內都不如, 又如何在國內競爭, 要頹廢我相信內地大把人可以更頹廢, 可以以更平既價錢及更快既時間做出一舊野, 當然往後在維護上極有可能會引申更多問題, 以及付出更多金錢. 當上海要成為金融城市時, 自己已經意識到, 香港做唔好質素管理, 就只會不進則退. 作為大企業, 就如同李嘉誠話和黃極有可能上海上市一樣, 只要在內地上市便可以了, 分析而言, 香港有一套好既金融體系, 上海只要參考下, 再加上最新既科技配合, 超越香港不是難事. 那中小企呢, 經驗而言係因為無咁大規模, 資金同時間, 所以對質量不去注重, 以咁既環境下, 又係一個兩難既局面.

而自已呢…可能因為唔想再係個無質素, 頹廢既環境下做野, 唯有改變一下個環境, 提升下自己, 及為香港 IT 員工對 Software Engineering 既基本知識同質素.