2009 frog design criticisms
From CSSEMediaWiki
(Difference between revisions)
Line 1: | Line 1: | ||
+ | ---- | ||
+ | <div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"> | ||
+ | ---- | ||
+ | =[http://abaviteha.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]= | ||
+ | ---- | ||
+ | =[http://abaviteha.co.cc CLICK HERE]= | ||
+ | ---- | ||
+ | </div> | ||
WARNING: Spoiler! | WARNING: Spoiler! | ||
Revision as of 10:07, 24 November 2010
WARNING: Spoiler!
Try criticising the Frogs design BEFORE reading this.
Criticisms of the Frog Design (2009)
- Riel's heuristics
- 2.1 Hide data within its class: The AdultFrog class exposes an array of eggs it has laid.
- 2.9 Keep related data and behavior in one place: Frog and FrogBrain are separate classes.
- 3.5 Interface should be dependent on model: The Move interface contains a method called display; the model is dependent on the interface
- 3.9 Avoid verb classes: The Move interface is a verb. It could be called Movable or similar (although that name is still not great for other reasons).
- 3.10 Agent classes irrelevant: The Biologist class is an agent.
- 5.14 Avoid becomes: A frog will at various stages be an egg, tadpole and adult frog.
- Solution: State or strategy pattern
- 5.1 Inheritance for specialization: A toad is not a frog; it's inheritance for implementation.
- 5.17 Avoid no-op overrides: The hop and swim methods of Egg do nothing.
- 5.12 Beware type switches: Tadpole has a type attribute which is used in swim() (5.13 broken as well?)
- The biologist should have the saute method, not the frog itself.
- For a better solution to the XML export ability, see a froggy visitor (last year's class)