设计模式 - 创建型模式(Creational Patterns)

设计模式 - 创建型模式(Creational Patterns)

创建型模式提供了一种在创建对象的同时隐藏创建逻辑的方式,而不是使用 new 运算符直接实例化对象。这使得程序在判断针对某个给定实例需要创建哪些对象时更加灵活。包括:

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

 

posted @ 2020-02-17 09:08  double蠢  阅读(199)  评论(0编辑  收藏  举报