Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Abstract Factory and Factory Method Design Patterns
- This is a very basic toy app to demonstrate Factory design patterns
- ## Abstract Factory
- **Definition** “Provide an interface to create families of related or dependent objects without specifying their concrete classes.”
- * Also known as Factory of factories, Super factory, Kit
- * Encapsulates mechanism that creates related concrete classes
- * Helps to enforce usage rules for related components
- * Generally makes use of the Factory Method Pattern
- ## Factory Method
- **Definition** “Define an interface for creating an object, but let subclasses decide which class to instantiate.”
- * Key characteristics:
- * Creates a new object
- * Returns a type that is an abstract class or an interface
- * It's implemented by several classes
- * A common example is the `iterator()` method in Java, which fulfills all three key characteristics above
Add Comment
Please, Sign In to add comment