abstract facto..
Design pat..
on creational patte.. , by sandheepgr

This is a @creational design pattern and similar to @factory pattern .

Here, we create an AbstractFactory class that return the required type and it acts as a super factory that the concrete factory classes can extend and implement.

abstract AbstractFactory {
abstract Bird getBird(type);
}

class BirdFactory extends AbstractFactory {
Bird getBird(type) {
// Check type and return matched.
}
}

The abstract factory is an object and can contain multiple factory methods in it.

 0
 
 22
Download the app free for more content with recommendations and preferences.

Are you a subject matter expert ?

Craft beautiful single page ideations on topics under your area of expertise and get recognized.