Design Patterns · java

Factory Design Pattern

if we have a super class and n sub-classes, and based on data provided, we have to return the object of one of the sub-classes, we use a factory pattern. Example: Let’s suppose an application asks for entering the name and sex of a person. If the sex is Male (M), it displays welcome message… Continue reading Factory Design Pattern