In this video, discover how the Abstract Factory pattern works. Learn when the Abstract Factory pattern should be used and how it can provide a better structure for writing code.
- [Instructor] The Abstract Factory Pattern…provides an interface for creating families of objects…without specifying what their concrete types are.…It should be used when there is a system…that creates objects, but how those objects are created…should be hidden from view.…In particular, it is used when applications…have families of objects.…The application should be able to choose…which of a selection of families it wants to use.…The abstract factory pattern can ensure…that family groups are used together.…Say, for example, there is an application…that builds bicycles.…
First, all of the individual bike parts need to be built.…The wheels, handlebars, gear and frame, and so on,…need to be made, and not just any old parts.…To make a mountain bike, for example,…you need wheels with a strong frame and thick tires.…Mountain bikes also need straight handlebars,…so these different parts are examples…of a family of objects that need to be made together.…The process of making a mountain bike…is different to making a road bike,…
Released
8/29/2018- What are creational design patterns?
- Avoid complex constructors
- Implementing the Builder pattern
- Multithreading with the Singleton pattern
- Using the Prototype pattern
- Implementing a simple Factory Method pattern
- Making code more flexible with the Abstract Factory pattern
Share this video
Embed this video
Video: Understand the Abstract Factory pattern