1 / 11

Marine Biology Simulation Part III: Assignment, Milestone 2

Marine Biology Simulation Part III: Assignment, Milestone 2. Dung “Zung” Nguyen Mathias Ricken Stephen Wong. TeachJava 2004! June 25, 2004. Rice MBS Assignment. Milestone 1 Part 1: KnightFish Add a new fish species to the simulation Part 2: WrappingEnv Add a new kind of environment

sanaa
Download Presentation

Marine Biology Simulation Part III: Assignment, Milestone 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Marine Biology SimulationPart III: Assignment, Milestone 2 Dung “Zung” Nguyen Mathias Ricken Stephen Wong TeachJava 2004! June 25, 2004

  2. Rice MBS Assignment • Milestone 1 • Part 1: KnightFish Add a new fish species to the simulation • Part 2: WrappingEnv Add a new kind of environment • Milestone 2 • Part 3: Internals Re-implement parts of the simulation framework • Part 4: Behavior Strategies Refactor framework to allow dynamic behavior changes

  3. Preparation • Download materials for Milestone 2 • milestone2.zip • Unzip into empty directory • Open DrJava • Copy your drjava.jar into the project directory • Remove RiceMBSfw.jar from “Extra Classpath”

  4. Part 3: Internals • Open the DrJava_Test_* files tests package • Hit the test button • Several tests will fail • Critical portions of the framework have been removed • Tests provide students with feedback • Guide the way without giving away the answer • Better error messages than just “NullPointerException” and the like

  5. Part 3: Internals • Code missing in several places of the framework • Fish • Local environment • Global environment • Gives students a tour of the entire framework

  6. Re-implement as per given specs. Re-implement as per given specs. Part 3: Internals Unit tests guide the way

  7. Part 3: Internals • Students gain insight into • Abstraction and loose coupling • Message passing • Writing large frameworks • Working with someone else’s code • Requires extensive work within existing framework • At the end of this part, students have completely restored the original functionality

  8. Part 4: Behavior Strategies • Once students have understood the existing framework, they can improve it • Point out one of the flaws • Fish cannot change behavior • This part involves refactoring the old code and creating a new class hierarchy

  9. + void move() + void move() + void move() Part 4: Behavior Strategies Separate the variants from the invariants Strategy Pattern

  10. Part 4: Behavior Strategies • Students have the opportunity to • Apply design patterns to improve the project • Refactor a substantial portion of the code • Experience how loose coupling makes this easy • Use unit tests to protect against previous bugs • Maintain documentation • Requires new design and code that augments existing framework • At the end of the assignment, students will have added a major feature to the simulation

  11. Summary • Students slowly gain experience with the framework • Parts 1 and 2 provides a lot of support • Part 3 gives students more responsibility, but unit tests provide guidance • Part 4 gives students freedom to design and improve • Compelling and entertaining example of object-oriented design

More Related