CSC223 2004F, Class 10: UML-4 Admin: * Charlie dropped. Boo Charlie. * Homework 2 due. * Homework 3 assigned in vague form. * Start reading the XP book. (No, not Windoze XP. XP as in "eXtreme Programming".) (No, it's not part of the Xgames.) Overview: * Sequence diagram example * Your questions and our answers * State diagram example * About the homework What do the different diagrams suggest? * See your notes Which do you prefer? * Event driven because "it's more object-oriented" Why are these diagrams better than just writing code? * Some folks think visually * Show relationships of stuff far separated in the code Should worlds know about positions of bugs? * No * Complicated * Yes * Prevents "cheating" * World is already keeping track of a lot of stuff. What's a few bugs more? * Bugs don't necessarily control the relationship of themselves to the world (a bug can't necessarily move onto a space with a rock in it) * It will make it easier for a bug to query what's around it Given these design decisions, which technique should we use for drawing the world? * Probably v3 (event-driven, world keeps track of bugs) Some design issues * Should theWorld and aWorldView be merged into one class? Why or why not? * No, because we might want to have different views of the same world (one at large scale, one at small scale) * Should aWorldView and aDrawingWindow be merged into one class? Why or why not? * aDrawingWindow might change the worldView associated with it (or vice versa) * Different drawing windows might draw differently. Homework for Friday the 24th of September, 2004 c.e. * Implement a *rough* (working, but need not be perfect) version of theWorld * The world, when created, should populate itself randomly. * There are limited kinds of objects that go in the world. * Bugs * Food * Trees (which produce food) * BugEaters * Rocks * BugColonies * Pheremones, NONE OF WHICH ARE IN THE WORLD INITIALLY * Worlds must support listeners. * Interesting programming model. When an object changes, others may care. * addListener(WorldListener iCare) * You need not implement Bugs, Food, Trees, etc. Use "Stub" classes. Questions on the reading? * Quiz Monday! Happy Slightly-Belated New Year!