Abstract factory design pattern.
Background - Please read the factory concept or skip if you have a good understanding of it. When you have a requirement to run your product on multiple operating systems (i.e., Windows, RedHat Linux, Mac, Solaris, HPUX, etc.), the only difference is how your object is getting created on different platforms. The business logic and look and feel of the product has to remain the same on all OS. You are creating the same set of objects but for different–different OS families. Here you have to handle the creation part as per OS, yes we are talking about a class whose core behavior is to create objects. Whenever you get such kind of situations where the same set of objects are getting created differently depending upon the family, they belong to. You shall start thinking about abstract factory design pattern. Abstract factory design pattern – It is A class-based design pattern (not object-based). Very important for any product where the designer is looking at portability as o...