Design Patterns - Chapter 1 Summary

Chapter 1 introduced the concept of design patterns, basically techniques others have formulated to solve a given set of problems. The idea is simple: a lot of problems exist: just find a pattern that matches the problem and you've pretty much solved it.

It also went into GoF, or the Gang of Four, folks who initially published the book of 23 patterns back in 1995.

The first pattern covered was the Mediator pattern, which basically handles "navigation". Different pages of a website require navigation to each other. Rather than have that each page contain the navigation to other pages, it passes this over to the mediator, which handles the correct redirection.

Next off, the Adapter pattern. Basically if you have something that used to "fit" together, but one piece has changed to now only accept newer objects, you write an intermediate adapter that handles talking to both the old and new. You then fit it in between, naturally.

Proxy patterns: implement something internal to the object so it doesn't know it's talking to a remote object. Need a real work example to understand its true worth as a pattern.

Last off, the Observer pattern, which I found most interesting. You have objects and you have "observers". More than one observer can exist. Each observer registers itself with the object. When the object changes, it sends a notification to the observers that have registered so each can do what it needs to do.