- Spring 5 Design Patterns
- Dinesh Rajput
- 238字
- 2021-07-08 09:59:31
Abstract factory design pattern
The Abstract Factory pattern comes under the creational design pattern. It is a high-level design pattern compared to the factory method design pattern. According to this design pattern, you just define an interface or abstract class to create a related dependent object without specifying its concrete subclass. So here, the abstract factory returns a factory of classes. Let me simplify it for you. You have a set of factory method design patterns, and you just put these factories under a factory using the factory design pattern, which means that it is simply a factory of factories. And there is no need to take the knowledge about all of the factories into the factory--you can make your program using a top-level factory.
In the Abstract Factory pattern, an interface is responsible for creating a factory of related objects without explicitly specifying their classes. Each generated factory can give the objects as per the Factory pattern.
The benefits of the Abstract Factory pattern are as follows:
- The Abstract Factory Design provides loose coupling between the component families. It also isolates the client code from concrete classes.
- This design pattern is a higher-level design than the Factory pattern.
- This pattern provides better consistency at construction time of objects across the application.
- This pattern easily swaps component families.
- Cocos2d Cross-Platform Game Development Cookbook(Second Edition)
- Drupal 8 Blueprints
- Cross-platform Desktop Application Development:Electron,Node,NW.js,and React
- React Native Cookbook
- OpenCV for Secret Agents
- Building a Recommendation Engine with Scala
- C# 8.0核心技術(shù)指南(原書第8版)
- Getting Started with Hazelcast(Second Edition)
- SQL Server實用教程(SQL Server 2008版)
- Mastering Git
- HTML5開發(fā)精要與實例詳解
- IBM Cognos TM1 Developer's Certification guide
- Exploring SE for Android
- 數(shù)據(jù)庫技術(shù)及應(yīng)用教程上機(jī)指導(dǎo)與習(xí)題(第2版)
- 少年小魚的魔法之旅:神奇的Python