Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Hope this helps. It describes the various types of factories. I used <a href="https://rads.stackoverflow.com/amzn/click/0596007124" rel="nofollow noreferrer">Head First Design Patterns</a> as my reference. I used <a href="http://yuml.me/" rel="nofollow noreferrer">yuml.me</a> to diagram.</p> <p><strong>Static Factory</strong></p> <p>Is a class with a Static Method to product various sub types of Product.</p> <p><img src="https://i.stack.imgur.com/5txhK.png" alt="Static Factory"></p> <p><strong>Simple Factory</strong></p> <p>Is a class that can produce various sub types of Product. (It is better than the Static Factory. When new types are added the base Product class does not need to be changed only the Simple Factory Class)</p> <p><img src="https://i.stack.imgur.com/O4mxc.png" alt="Simple Factoryt"></p> <p><strong>Factory Method</strong></p> <p>Contains one method to produce one type of product related to its type. (It is better than a Simple Factory because the type is deferred to a sub-class.)</p> <p><img src="https://i.stack.imgur.com/nyqGK.png" alt="Factory Method"></p> <p><strong>Abstract Factory</strong></p> <p>Produces a Family of Types that are related. It is noticeably different than a Factory Method as it has more than one method of types it produces. (This is complicated refer to next diagram for better real-life example).</p> <p><img src="https://i.stack.imgur.com/A6riH.png" alt="Abstract Factory"></p> <p><strong>Example From The .NET Framework</strong></p> <p>DbFactoriesProvider is a Simple Factory as it has no sub-types. The DbFactoryProvider is an abstract factory as it can create various related database objects such as connection and command objects.</p> <p><img src="https://i.stack.imgur.com/Qz6AK.png" alt="Abstract Factory From .NET Framework"> ​​​</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload