The Factory method versus Abstract Factory method

Now that you have learned the Factory method and Abstract Factory method, let's see the comparison of the two:

Factory method

Abstract Factory method

This exposes a method to the client to create the objects

Abstract Factory method contains one or more factory methods to create a family of related objects

This uses inheritance and subclasses to decide which object to create

This uses composition to delegate responsibility to create objects of another class

The factory method is used to create one product

Abstract Factory method is about creating families of related products

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.190.155.49