Wal's Fish Tank

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
m (Some more tweaks)
 
(One intermediate revision by one user not shown)
Line 49: Line 49:
 
[[Image:Fish_Factory.jpeg|'''Fish Factory''']]
 
[[Image:Fish_Factory.jpeg|'''Fish Factory''']]
  
 +
 +
----
  
 
===The Result===
 
===The Result===
Line 54: Line 56:
  
 
[[Image:Fish_Result.jpeg|'''Fish Result''']]
 
[[Image:Fish_Result.jpeg|'''Fish Result''']]
 +
 +
 +
Note that this design does have flaws that are introduced by the use of patterns, see [[Design patterns break rules]].

Latest revision as of 22:50, 14 October 2009

Contents

Wal's Fish Tank

This content is duplicated from Wal's Cosc324 lecture material of 2008. It has been reproduced with the permission of Lord Wal (One pattern to rule them all and in the design philosophy bind them!).

Simulated fish tank

  • Lots of different kinds of fish
  • Only ever one tank
  • Multiple views possible
  • Schools of fish
  • Remoras and barnacles
  • Fish spawn new fish


Fish


Singleton

Only ever one tank


Fish Singleton


Observer

Multiple views possible (FishView is a gui view)


Fish Observer


Composite

Schools of fish


Fish Composite


Decorator

Remoras and barnacles


Fish Decorator


Factory Method

Fish spawn new fish


Fish Factory



The Result

Fish Result


Note that this design does have flaws that are introduced by the use of patterns, see Design patterns break rules.

Personal tools