Here's a quick summary of Design Guidelines for your Design Toolbox.
Object Oriented Basics
- Abstraction
- Encapsulation
- Polymorphism
- Inheritance
Object Oriented Principals
- Encapsulate what varies (think strategy pattern)
- Favor composition over inheritance
- Program to interfaces not implementations
Object Oriented Patterns
- Strategy – Defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm very independently form clients that use it.
- Observer – Defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
- Decorator – Attaches additional responsibilities to an object dynamically. Decorators provide a flexible alternative to sublcassing for extending functionality.
- Factory Method Pattern – Defines an interface for creating an object, but lets subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses. Creates objects through inheritance.
- Abstract Factory Pattern – Provides an interface for creating families of related or dependent objects without specifying their concrete classes. Creates objects through composition.
General Design Principals