Abstract Factory Design Pattern Coding Exercise

In this post we will share information regarding Abstract Factory Pattern.

Abstract Factory Pattern very important for Automation QAs to understand if need to develop complex automation frameworks in high performing business applications testing.

Brief Introduction about Abstract Factory Design Pattern

The Abstract Factory Pattern is one of the creational design patterns. We can say Abstract Factory patterns acts as a super-factory which produces other factories. The role of the Abstract Factory is to provide an interface for creating families of related or dependent objects without specifying their concrete classes.

If we are using an abstract factory pattern, then the client program will never create platform objects directly, they ask the factory to perform this task for them. So the factory object has the total responsibility for proving this service for the entire platform family. You can use this pattern if-

  • You need your application to be independent of how its objects are created.

  • To decouple classes and way its objects are created.

  • If your business logic involves families of related or dependent objects.

The pattern is great when creating predefined objects and providing abstraction, and automation projects majorly comes into picture when all interfaces have developed and need to be tested. That's why Abstract Factory Pattern significantly used across complex business applications test automation.

Learn Abstract Factory Pattern by Example and Video

Here is You tube video that will talk about the project that we going to develop using Abstract Factory

Here is sample problem which need to be solved using Abstract Factory:

Here is project structure which need to be developed. Try to write your own code before downloading the shared code.

Here is Download link to download project source code:

Click here to download