- Hands-On Design Patterns with Kotlin
- Alexey Soshin
- 161字
- 2021-06-25 20:49:28
Abstract Factory
Abstract Factory is a greatly misunderstood pattern. It has a notorious reputation for being very complex and bizarre but actually, it's quite simple. If you understood the Factory Method, you'll understand this one in no time. This is because Abstract Factory is a factory of factories. That's all there is to it, really. The factory is a function or class that's able to create other classes. Abstract Factory is a class that creates factories.
You may understand that and still wonder what the usages of such a pattern may be. The main usage of Abstract Factory in the real world would probably be frameworks, most notably Spring Framework, which uses the notion of Abstract Factory to create its components out of annotations and XML files. But since creating our own framework may be quite tiresome, let's take another example where this pattern will be very useful—a strategy game.
We'll call it CatsCraft 2: Revenge of the Dogs.
- Mastering Ext JS(Second Edition)
- 零基礎搭建量化投資系統:以Python為工具
- Mobile Application Development:JavaScript Frameworks
- C#程序設計實訓指導書
- Practical Data Science Cookbook(Second Edition)
- JSP開發案例教程
- 用Flutter極速構建原生應用
- 深度學習:Java語言實現
- Mastering Unity 2D Game Development(Second Edition)
- Go語言編程
- IoT Projects with Bluetooth Low Energy
- SFML Game Development
- Enterprise Application Architecture with .NET Core
- Mastering JavaScript Promises
- Getting Started with Windows Server Security