Friday, October 6, 2017

Head first design pattern

Chapter 1: Strategy Pattern

The one constant in soft ware development: CHANGE
Design Principle 1:
Identify the aspects of your application that vary and separate them from what stays the same.(take the parts that vary and encapsulate them, so that later you can alter or extend the parts that vary without affecting those that don’t.)
Design Principle 2:
Program to an interface, not an implementation.
Design Principle 3:
Favor composition over inheritance.

Strategy

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.

Facade

The Facade Pattern provides a unified interface to a set of interfaces in a subsytem. Facade defines a higherlevel interface that makes the subsystem easier to use.

Singleton