Archive

Posts Tagged ‘design patterns’

The Observer Pattern

January 6th, 2010 No comments
Goats detected!

Right now, the GoatDetector is notifying you: "Goats detected"!

The idea of Design Patterns in computer science is one of many ideas that hadn’t be formalized when I was first learning about computers, but that’s not going to stop me from talking about it, now is it? :-)

The basic idea is that there are a number of recurring problems that occur in a variety of projects, and there are “design patterns” that can help solve these problems in a fairly well-defined way. They aren’t algorithms, exactly; they’re more like software design structures that help data flow in useful ways.

For instance, let’s say you have a class and you want to instantiate a single instance of that class that everyone else can get a reference to and use. There’s a pattern for that (The Singleton Pattern), but today I’m talking about another one: The Observer Pattern.

Read more…

Share