Programming patterns

From GPWiki

Files:GUITutorial_warn.gif The Game Programming Wiki has moved! Files:GUITutorial_warn.gif

The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server.

However, the GPWiki forums are still active! Come say hello.

Behavioral patterns

  • Observer When an object changes state, other objects are notified
  • State Changing object behavior depending on the state of an object
  • Strategy Supplying different interchangeable variants of an algorithm in a class
  • Template method Supplying an algorithm in which sub-classes can redefine certain steps without changing the overall algorithm
  • Visitor Separating operations on an object from the object itself in an extendable way. The basis for "double dispatch".

Creational patterns

  • Singleton Implementing a class that has exactly one instance and a global point of access
  • Abstract Factory Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
  • Builder Implementing a class that builds parts of a complex object.

Structural patterns

  • Composite Combining several objects into an object that has the same behavior as its parts