📙
Design Pattern
  • Introduction
  • 0. About Design Pattern
  • 1. Singleton
  • 1.1 Eager Singleton (a.k.a Pessimistic Lock Singleton)
  • 1.2 Lazy Singleton (a.k.a Optimistic Lock Singleton)
  • 1.3 理解Singleton
  • 1.4 Cache Singleton
  • 1.5 Extend Singleton
  • 1.6 Double Check and Lock Singleton
  • 1.7 Lazy Initialization Holder Class
  • 1.8 Enum Singleton
  • 1.9 Conclusion
  • 2. Factory
  • 2.1 Simple Factory
  • 2.2 Factory
  • 2.3 Abstract Factory
  • 2.4 Conclusion
Powered by GitBook
On this page

Was this helpful?

2. Factory

Factory是design pattern裡最常聽到的物件生成模式, 這邊我會依照抽象程度由低到高介紹以下三種factory:

  • Simple Factory: 抽象程度最低

  • Factory: 通常講的工廠模式

  • Abstract Factory: 抽象程度較高

Previous1.9 ConclusionNext2.1 Simple Factory

Last updated 5 years ago

Was this helpful?