Welcome to Design Patterns
HFDPRead HFDP online
- On the UCSB campus (or any UC campus)
- Off-campus with a UCSBNetID
1: Welcome to Design Patterns
TODO: Fill in HFDP_Chapter_1.md with notes for Chapter 1 of HFDP.
Chapter 1: Intro to Design Patterns
It started with a simple SimUDuck app
This page introduces the SimUDuck application. This is a silly example, like so many of those used in the Head First books, but since it forms the basis of the rest of the chapter, its important to at least suspend our disbelief and “go with it”. Try to understand the premise of what the SimUDuck application is trying to accomplish: namely, realistic simulation of a variety of kinds of ducks swimming and quacking.
But now we need the ducks to FLY
The key point here is that “some behavior about the class needs to change”. The idea of making the ducks fly is a shorthand in this silly example for something that happens in real-life all the time: some user requirement gets added, or something changes, and a component of the software has to be able to do something that it didn’t do before.
The essence of design patterns, as we’ll see, is designing the software in a way that makes it easier to make these changes—setting ourselves up for success—rather than making it difficult (setting ourselves up for failure.)