Skip to main content

Posts

Showing posts from February, 2006

Lessons from Head First Design Pattern - 1

OO Basics --------------------------- - Abstraction - Encapsulation - Polymorphism - Inheritance OO Principles --------------------------- - Encapsulate what varies - Favor composition over inheritance - Program to interface, not implementations. - Strive for loosely coupled designs between objects that interact - Classes should be open for extension but closed for modification. - Depend on abstractions. Do not depend on concrete classes. OO Patterns --------------------------- Strategy - Defines a family of algorithms, encapsulate each one, and makes them interchangeable. Strategy lets the algorithm vary independently from 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 - Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality. Factory Method - Define an