Object Oriented Programming Resources/Head First Design Pattern Recaps
Jump to navigation
Jump to search
Design Principles
- Identify the aspects of your application that vary and separate them from what stays the same. (1/9)
- Program to an interface, not an implementation. (1/11)
- Favor composition over inheritance. (1/23)
- Strive for loosely coupled designs between objects that interact. (2/53)
- Classes should be open for extension, but closed for modification. (3/86)
- Depend upon abstractions. Do not depend upon concrete classes. (4/139)
Patterns (by order)
- The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
- The Observer Pattern defines a one-to-many dependency between objects so that when one object changes state, all of its dependents are notified and updated automatically.
- The Decorator Pattern attaches additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
- The 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.
- The Abstract Factory Pattern provides an interface for creating families of related or dependent objects without specifying their concrete classes.