Wal's Fish Tank
From CSSEMediaWiki
(Difference between revisions)
Douglas Wall (Talk | contribs) (A duplication of Wal's 324 lecture example.) |
Douglas Wall (Talk | contribs) |
||
(3 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
== Wal's Fish Tank == | == Wal's Fish Tank == | ||
− | This content is duplicated from Wal's | + | This content is duplicated from [[User:Warwick Irwin|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=== | ===Simulated fish tank=== | ||
Line 11: | Line 11: | ||
*Fish spawn new fish | *Fish spawn new fish | ||
− | |||
− | ====Singleton==== | + | [[Image:Fish.jpeg|'''Fish''']] |
+ | |||
+ | |||
+ | ====[[Singleton]]==== | ||
Only ever one tank | Only ever one tank | ||
− | |||
− | + | [[Image:Fish_Singleton.jpeg|'''Fish Singleton''']] | |
− | + | ||
− | |||
− | ====Composite==== | + | ====[[Observer]]==== |
+ | Multiple views possible (FishView is a gui view) | ||
+ | |||
+ | |||
+ | [[Image:Fish_Observer.jpeg|'''Fish Observer''']] | ||
+ | |||
+ | |||
+ | ====[[Composite]]==== | ||
Schools of fish | Schools of fish | ||
− | |||
− | ====Decorator==== | + | [[Image:Fish_Composite.jpeg|'''Fish Composite''']] |
+ | |||
+ | |||
+ | ====[[Decorator]]==== | ||
Remoras and barnacles | Remoras and barnacles | ||
− | |||
− | ====Factory Method==== | + | [[Image:Fish_Decorator.jpeg|'''Fish Decorator''']] |
+ | |||
+ | |||
+ | ====[[Factory Method]]==== | ||
Fish spawn new fish | Fish spawn new fish | ||
− | [[Image:Fish_Factory.jpeg | + | |
+ | [[Image:Fish_Factory.jpeg|'''Fish Factory''']] | ||
+ | |||
+ | |||
+ | ---- | ||
===The Result=== | ===The Result=== | ||
− | [[Image:Fish_Result.jpeg | + | |
+ | [[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
Singleton
Only ever one tank
Observer
Multiple views possible (FishView is a gui view)
Composite
Schools of fish
Decorator
Remoras and barnacles
Factory Method
Fish spawn new fish
The Result
Note that this design does have flaws that are introduced by the use of patterns, see Design patterns break rules.