Hello,
I am trying to understand the Abstract Factory design pattern. I am having a lot of trouble with it. I am trying to use the following example to develop a UML class diagram:
Car designers can design many different types of cars. Cars can have two doors, or they can have four doors. Cars can be four-wheel drive, or they can be two-wheel drive. Cars are made up of different parts: wheels, doors, engine, transmission, etc. Each part has a different operation: For example, transmission can have first_gear(), second_gear(), third_gear(), fourth_gear(), reverse(), neutral().
The car parts (listed above) are available in Families: Honda, Jeep, Ford, etc.
Using the Abstract Factory design method, I need to develop a software system so that the system can easily change cars from one family to another.
Here is what I have been thinking so far: Having one factory, and multiple abstract factories. So, the abstract factories create the model, whereas the factory creates the parts...
Can anyone help? Thanks..