Guest User

Untitled

a guest
May 21st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. # Abstract Factory and Factory Method Design Patterns
  2. This is a very basic toy app to demonstrate Factory design patterns
  3.  
  4. ## Abstract Factory
  5. **Definition** “Provide an interface to create families of related or dependent objects without specifying their concrete classes.”
  6. * Also known as Factory of factories, Super factory, Kit
  7. * Encapsulates mechanism that creates related concrete classes
  8. * Helps to enforce usage rules for related components
  9. * Generally makes use of the Factory Method Pattern
  10.  
  11. ## Factory Method
  12. **Definition** “Define an interface for creating an object, but let subclasses decide which class to instantiate.”
  13. * Key characteristics:
  14. * Creates a new object
  15. * Returns a type that is an abstract class or an interface
  16. * It's implemented by several classes
  17. * A common example is the `iterator()` method in Java, which fulfills all three key characteristics above
Add Comment
Please, Sign In to add comment