設計模式分類


1.創建型模式
這些設計模式提供了一種在創建對象的同時隱藏創建邏輯的方式,而不是使用 new 運算符直接實例化對象

這使得程序在判斷針對某個給定實例需要創建哪些對象時更加靈活。

  • 工廠模式(Factory Pattern)
  • 抽象工廠模式(Abstract Factory Pattern)
  • 單例模式(Singleton Pattern)
  • 建造者模式(Builder Pattern)
  • 原型模式(Prototype Pattern)

2.結構型模式
這些設計模式關注類和對象的組合。繼承的概念被用來組合接口和定義組合對象獲得新功能的方式。

  • 適配器模式(Adapter Pattern)
  • 橋接模式(Bridge Pattern)
  • 過濾器模式(Filter、Criteria Pattern)
  • 組合模式(Composite Pattern)
  • 裝飾器模式(Decorator Pattern)
  • 外觀模式(Facade Pattern)
  • 享元模式(Flyweight Pattern)
  • 代理模式(Proxy Pattern)

3.行為型模式
這些設計模式特別關注對象之間的通信。

    • 責任鏈模式(Chain of Responsibility Pattern)
    • 命令模式(Command Pattern)
    • 解釋器模式(Interpreter Pattern)
    • 迭代器模式(Iterator Pattern)
    • 中介者模式(Mediator Pattern)
    • 備忘錄模式(Memento Pattern)
    • 觀察者模式(Observer Pattern)
    • 狀態模式(State Pattern)
    • 空對象模式(Null Object Pattern)
    • 策略模式(Strategy Pattern)
    • 模板模式(Template Pattern)
    • 訪問者模式(Visitor Pattern)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM