Abstract Factory: Implementation and Example
Learn the Abstract Factory design pattern by implementing an example program.
We'll cover the following...
In this example, we’ll create an audio player application that’ll be able to play audio on either Windows or Linux. It’s similar to what we did when we understood the implementation of the Factory Method pattern. However, there will be some crucial differences.
In the example that we’ve used to demonstrate the Factory Method pattern, we’ve been returning a concrete OS-specific implementation of an audio player depending on which operating system the software runs on. However, this time we’ll be returning concrete implementations of OS-specific individual functionalities. We’ll have an object that will provide an abstraction for the “Play” button and another object that ...