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

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

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

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

猜你喜欢

转载自www.cnblogs.com/lichu-lc/p/12320303.html
今日推荐