Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

洗白你的軟體架構

2,777 views

Published on

任何軟體系統都有架構,雖然大部分的時間你的軟體架構都很髒。但你是否也曾有過這樣的夢想,有一天萬能的天神賜給你神奇的力量,讓你有能力將它洗白?


在本次C. C. Agile活動中,Teddy將請與會者動手視覺化軟體架構,並逐步將其演化成軟體設計大師Uncle Bob口中的《Clean Architecture》。


了解原理之後,Teddy將討論實作《Clean Architecture》所可能遭遇的技術問題,包含隔絕相依性、Use Case介面設計與程式碼分層等。 歡迎大家一起來「洗架構」。

Published in: Software

洗白你的軟體架構

  1. 1. Teddy Chen teddy@teddysoft.tw http://teddy-chen-tw.blogspot.tw/ April 12 2018
  2. 2. Copyright@2012-2018 Teddysoft
  3. 3. Copyright@2012-2018 Teddysoft
  4. 4. Copyright@2012-2018 Teddysoft
  5. 5. The architecture of a software is the shape given to that system by those who build it. (軟體架構是構建者給予它的形狀。) Copyright@2012-2018 Teddysoft 《Clean Architecture》
  6. 6. Copyright@2012-2018 Teddysoft
  7. 7. Copyright@2012-2018 Teddysoft
  8. 8. Copyright@2012-2018 Teddysoft
  9. 9. The form of that shape is in the division of the system into components, the arrangement of those components, and the ways in which those components communicate with each other. (該形狀的形式是將系統劃分為組件,這些組 件的佈置以及這些組件彼此溝通的方式。) Copyright@2012-2018 Teddysoft 《Clean Architecture》
  10. 10. Copyright@2012-2018 Teddysoft Source : https://goo.gl/NL1LYK
  11. 11. Copyright@2012-2018 Teddysoft
  12. 12. The ultimate goal of software architecture is to minimize the lifetime cost of the system and to maximize programmer productivity. Copyright@2012-2018 Teddysoft 《Clean Architecture》
  13. 13. The ultimate goal of 加班 is to minimize the lifetime cost of the system company and to maximize programmer productivity. Copyright@2012-2018 Teddysoft 《Clean Architecture》 https://goo.gl/aCZHLM
  14. 14. The purpose of the shape is to facilitate the development, deployment, operation, and maintenance of the software system contained within it. (形狀的目的是為了便於其中包含的軟體系統 的開發、部署、操作和維護。) Copyright@2012-2018 Teddysoft 《Clean Architecture》
  15. 15. • Their trouble do not lie in their operation; rather, they occur in their deployment, maintenance, and ongoing development. Copyright@2012-2018 Teddysoft 《Clean Architecture》
  16. 16. Copyright@2012-2018 Teddysoft
  17. 17. • The word architecture is often used in the context of something at a high level that is divorced from the low-level details, whereas design more often seems to imply structures and decisions at a lower level. • The low-level and the high-level structure are all part of the same whole. You cannot have one without the other; indeed, no clear dividing line separates them. There is simply a continuum of decisions from the highest to the lowest levels. Copyright@2012-2018 Teddysoft 《Clean Architecture》
  18. 18. Copyright@2012-2018 Teddysoft
  19. 19. Copyright@2012-2018 Teddysoft
  20. 20. Copyright@2012-2018 Teddysoft UI Application DB Model Dependency
  21. 21. Copyright@2012-2018 Teddysoft Dependency Inversion Principle 這是什麼設計模式? Copyright@2012-2018 Teddysoft 《Clean Architecture》
  22. 22. • 相依性的方向永遠從低層往高層 • 何謂低層,何謂高層? – 離I/O愈遠的越高層 Copyright@2012-2018 Teddysoft
  23. 23. Copyright@2012-2018 Teddysoft UI Application DB Model I/O I/O 畫成傳統的階層式架構不容易看出層次
  24. 24. Copyright@2012-2018 Teddysoft Model ApplicationUI DB Dependency Dependency 不一定要畫成六角形,也可以畫成圓形。
  25. 25. • Components • Arrangement of those components • Communication of the components Copyright@2012-2018 Teddysoft ✔ ✔ ?
  26. 26. • 同一層 • 跨層 Copyright@2012-2018 Teddysoft
  27. 27. Copyright@2012-2018 Teddysoft
  28. 28. Copyright@2012-2018 Teddysoft Model Application UI DB Adapter Port: Interfaces to the outside world Adapter: Bridges between boundaries
  29. 29. Copyright@2012-2018 Teddysoft Input Function Output int add (int x, int y) Browser network boundary
  30. 30. Copyright@2012-2018 Teddysoft Input Function Output int add (int x, int y) Browser network boundary Adapter x = request.getAsInt(“x”); y = request.getAsInt(“y”) result = add(x, y); response. add(“result”, result);
  31. 31. • 只有Application (Use Case)層可以存取 Domain (Entity)層。Domain物件不會透過Application階層 直接往外傳遞。 • 跨層傳遞資料需要內層定義介面,外層透過這個介面 與內層溝通。 Copyright@2012-2018 Teddysoft
  32. 32. Copyright@2012-2018 Teddysoft Host Service Command Contact
  33. 33. Copyright@2012-2018 Teddysoft
  34. 34. Copyright@2012-2018 Teddysoft
  35. 35. Copyright@2012-2018 Teddysoft
  36. 36. Copyright@2012-2018 Teddysoft
  37. 37. Copyright@2012-2018 Teddysoft
  38. 38. Copyright@2012-2018 Teddysoft
  39. 39. Copyright@2012-2018 Teddysoft
  40. 40. 《Clean Architecture》
  41. 41. Copyright@2012-2018 Teddysoft
  42. 42. • Screaming Architecture – Package by Feature or by layers • Duplication – A lot of DTOs • Dynamic typing languages • Annotations in the domain layer • Cross-cutting concerns – e.g., logging, security, transaction • Clean Architecture and Domain-Driven Design Copyright@2012-2018 Teddysoft
  43. 43. Copyright@2012-2018 Teddysoft
  44. 44. Copyright@2012-2018 Teddysoft
  45. 45. • 搞笑談軟工部落格 – http://teddy-chen-tw.blogspot.com • 搞笑談軟工Facebook – https://www.facebook.com/groups/teddy.tw • 泰迪軟體官方網站 – http://teddysoft.tw Copyright@2012-2018 Teddysoft

×