-
目標:solid、stable software
-
降低risk
-
consider key scenarios
- 該系統的核心Scenario究竟為何?也就是該系統到底要達到什麼樣的目的
-
design for common problems
- 20%的力氣解決80%的問題
-
appreciate the long term consequences of key decisions
- 計畫不如變化,變化不如長官一句話
-
poor architecture
-
unstable
- 硬幹
-
unable to support existing or future buiness requirement
- RFP可能沒有的
-
difficult to deploy or manage in a production environment
- 例如MSDTC的問題
-
consider issue
-
outline
- key scenarios
-
identify important quality attributes
- reliability
- scalability
- performance
- security
-
key areas of satisfaction and dissatisfaction
- 哪一些重點是User最重視的點,一定要達成的點,哪一些點是可以妥協的
-
三者之間的 trade off
- User experience
- Performance
- invest hardware or software
-
設計架構時,應把重心放在major components and elements
- data structures and algorithms or implementation不是這時候想的
- 很容易不小心就從抽象跳到實作
-
construct architectural solutions that address all of the relevant concerns,
can be deployed on your chosen infrastructure,
and provide results that meet the original aims and objectives
-
How will the users be using the application?
- User要怎麼用這系統
-
How will the application be deployed into production and managed?
- 系統怎麼部署與管理
-
What are the quality attribute requirements for the application, such as security,
performance, concurrency, internationalization, and configuration?
- 系統的關鍵指標有哪一些?安全?效率?整合?可靠度?彈性?
-
How can the application be designed to be flexible and maintainable over time?
- 如何設計系統保持持續的彈性與可維護性
-
What are the architectural trends that might impact your application now or after it has been deployed?
-
未來的架構或技術趨勢,是否會影響到系統,或是部署方式
- 例如layer to tier,例如client/server to Web,例如Web to 雲端
-
Architecture should
-
Expose the structure of the system but hide the implementation details.
- 系統架構圖,但避免落入實作細節
-
Realize all of the use cases and scenarios.
- 畫出Use Case Diagram and Activity Diagram
-
Try to address the requirements of various stakeholders.
- 定義出不同角色的需求
-
Handle both functional and quality requirements.
-
功能需求與品質需求都要兼顧
- 寫出來完全符合使用者的功能,但按一個鈕要跑五分鐘
-
Architectural landscape key trends
-
User empowerment
- 繪製出Use Case Diagram並確保scenario簡單明瞭
-
Market maturity
- 避免重新發明輪子,站在巨人肩膀上,使用已經成熟的pattern解決常見的問題。才能focus在實際有價值的部分
-
Flexible design
- loose coupling設計來增加重用性與可維護性,例如Dependency Injection
- SOA等service oriented的方式,增加與其他系統的互動
- Pluggable designs allow you to provide post-deployment extensibility.
-
Future trends
- 例如RIA、網路頻寬的增加、手機等行動平台、硬體效能、形式(社群網路、微網誌)、雲端等等
-
Principles of architecture design
- 哪一個部分是做錯時,可能導致最大的風險
- 哪部分是user最想改變的部分?哪部分delay了影響最小
- 關鍵假設是什麼?如何證明這個假設成立?
- 甚麼樣的情況下會需要重構或重新設計
-
應該把注意力集中在觀察,是否有需要重新設計的地方,應盡早發現且進行重構,避免修改成本過高
- 持續整合並且避免落入沒意義的追求完美
-
Key Principles
-
Build to change instead of building to last.
- 軟體開發過程中隨時可能需求改變,在設計架構時,應將這樣的彈性考慮進去
-
Model to analyze and reduce risk
- 使用modeling tool and visualization tool,幫助自己掌握需求以及設計決策、分析影響的程度。不要拘泥於形式,而失去了capability
-
Use models and visualizations as a communication and collaboration tool
- 透過models and visualization來降低溝通成本
-
Identify key engineering decisions
- 訂出關鍵技術決策以及列出該area最常犯的錯誤出來
-
反覆改善架構,不要想一次就設計的完整。應該先設計出一個可以拿來測試與驗證假設的架構
- 先將大架構做對,在追求細節技術
- 避免一頭栽入細節,如table schema設計。或是做了錯誤的假設,導致致命的錯誤
-
時時該提醒自己的問題
- 做了哪些假設
- 有哪些明確與可能隱含的需求
- 這樣的架構設計,最大的風險為何?
- 風險減緩計畫
- 目前的這個架構比原本的架構或是上一個候選架構好在哪裡
-
Key Principles details
- Common application architecture
-
Key design priciples
-
Separation of concerns
-
盡可能的把系統上該提供的功能分開
- 透過modeling的方式,來達到高內聚低耦合的model
-
Single Responsibility principle
- 切乾淨、獨立,每一模組或元件應只負責單一目的
-
Principle of Least Knowledge
- 封裝原則,用的人不必知道物件內的細節或實作方式
-
Don't repeat yourself (DRY)
-
避免重複,散落一地
- 基本上可透過Simian分析出來
-
Minimize upfront design
-
Only design what is necessary
- 除了不做可能會死的部分,可以先用點時間實作
-
降低複雜度的方式就是切開
- 例如切層,UI、BLL、DAL各司其職
-
Design Practices
-
the wide range of factors that can affect the ease of designing, implementing, deploying, testing, and maintaining your application
- Keep design patterns consistent within each layer
-
Do not duplicate functionality within an application
- 高內聚設計,易於重構、最佳化、可維護性高,尤其在需求變更時
-
Prefer composition to inheritance
- 繼承只有兩種用法,第一種是不用,第二種是很小心的使用
- 因為繼承會增加深度,且限制子類別的重用性
- 例如某一個子類別被父類別限制,但無法因這個CASE而修改父類別,因為子類別有很多。修改父類別,將影響其他繼承該父類別的子類別
-
Establish a coding style and naming convention for development
- 程式可讀性
-
Glossary
- 程式可讀性、一致性,溝通標準一致降低溝通成本
-
Maintain system quality using automated QA techniques during development
- SourceMonitor & Unit Testing & Daily Build by CI
- Consider the operation of your application.
-
Application Layer
-
Separate the areas of concern
-
切層,讓功能overlap的程度降到最低
- 可獨立的最佳化、重構、以及因應需求變更的調整
- 增加系統可讀性,因為都是切開的部分都是獨立的
-
Be explicit about how layers communicate with each other
-
明白的定義出layer之間如何傳遞資料
- 例如UI可透過domain object與service得到資料
- 例如不能跨層呼叫
- 但報表等特殊需求可以
-
Use abstraction to implement loose coupling between layers
- 例如先定義好interface,明確的知道該提供哪些東西,才進行實作
-
Do not mix different types of components in the same logical layer.
- 例如UI層不應該有太多的商業邏輯,應該著重在處理input與request,以及資料的呈現
-
Keep the data format consistent within a layer or component.
- 例如民國年、西元年。
- 例如日期有datetime、varchar型態、NVarChar型態
- 例如單位千元、百元顯示
- 例如空字串與DBNull的定義
-
Components, Modules, and Functions
-
A component or an object should not rely on internal details of other components or objects
- 封裝物件後,物件裡面的實作細節,應避免依賴於其他物件的細節,(代表耦合性太高)
-
Do not overload the functionality of a component
-
例如DB資料的連結透過UI的Control屬性就可以決定
- 物件越來越肥,越來越難維護,到處都客製化,就無法stable
-
Understand how components will communicate with each other.
- 瞭解物件之間如何互動,如何傳遞訊息後完成需求
-
Keep crosscutting code abstracted from the application business logic as far as possible
- 降低深度
- Crosscutting code refers to code related to security, communications, or
operational management such as logging and instrumentation
- 混在一起的程式,會導致無法extend與maintain
-
Define a clear contract for components
- 例如Domain object的Interface
- describe how other components can access the internal functionality
-
Key Design Considerations
-
決定一堆東西
- Determine the Application Type
- Determine the Deployment Strategy
- Determine the Appropriate Technologies
- Determine the Quality Attributes
- Determine the Crosscutting Concerns
-
第一版的guide
- 1
- 2