• Home
  • Archives
  • About Me
  Carson's Tech Note
  • Home
  • Archives
  • About Me
  • App Development
  • Blogging
  • Developer Tools
  • Web Frameworks
  • Languages Related
  • Software Engineering
  • Web Technology

委託模式 (Delegation pattern)

在物件導向程式設計中,有個守則叫做:

「多用合成,少用繼承」(Composition over inheritance)

而Delegation就是一個用合成取代繼承的好方法。

Read more   2018/05/15 posted in  Design Pattern
comments

工廠設計模式 (Factory Design Pattern)

工廠設計模式屬於「創建型模式」,規範「如何創建新Object」的程序設計。簡單來說就是故名思義,把創建的過程交給「工廠(Factory)」去做,而不是用家自己做。

Read more   2018/05/15 posted in  Design Pattern
comments

Carson's Tech Note

「坐井觀天,曰天小者,非天小也,其所見小也。夏蟲不可與語冰,非無冰也,以其未見冰也。」- 《學問與遊歷》
GitHub Email RSS

Categories

App Development Blogging Developer Tools Web Frameworks Languages Related Software Engineering Web Technology

Recent Posts

  • 開發者必備知識 - HTTP認證(HTTP Authentication)
  • 使用Babel處理ES6的 this 和 Arrow Function(箭頭函式)
  • 如何使用Android RecyclerView建立一個List列表
  • 翻牆必備:Shadowsocks建置教學
  • 翻牆專題:Proxy、VPN、Shadowsocks概念解釋

Copyright © 2015 Powered by MWeb,  Theme used GitHub CSS.