We propose the following Marine Biology Simulation as a framework for an exercise near the end of an objects-first introductory curriculum. The project teaches students how to use design patterns to correctly model abstraction and to achieve loose coupling between cooperating objects, creating a correct, robust, secure, flexible, and extensible system. Using an incremental, test-driven approach, the assignment first familiarizes students with the existing framework, subsequently asks them to rewrite critical portions of it, and finally lets them extend it to achieve additional flexibility.
Teaches students to work with a large, non-trivial project.
Flexible and secure design that is applicable to other challenging programming situations, like operating systems.
Test-driven development via unit testing provides immediate feedback regarding the correctness of their work while maintaining the freedom to implement code in different ways.
Entertaining project that offers an attractive visual component.
The visual nature of the project enables students to experience the design's flexibility and extensibility in a compelling manner.
This project is intended for students near the end of the second semester of an objects-first curriculum where they have already seen polymorphism, design patterns and component framework systems (see prerequisites below).
The Rice Marine Biology Simulation is not about fish. Instead, it teaches students some of the bigger concepts in software engineering, such as:
- Using design patterns to capture appropriate abstractions.
- Creating loose and abstract coupling between cooperating objects in the system to achieve correctness, robustness, security, flexibility, and extensibility.
- Using unit tests as specification.
- Using and building components and frameworks.
- Using refactoring to both simplify and enhance the framework.
- Using abstract factories to manufacture products whose concrete type is immaterial to the client.
- Using anonymous inner classes to define concrete instantiations, especially in the context of commands.
- Using the closure properties of inner classes to directly access both instance and final local variables.
- Numerous compelling demonstrations of polymorphic behavior, especially those that cannot be replicated with conditional statements.
The project is divided into two milestones. The supporting materials for Milestone 2 include sample solutions for the assignments from Milestone 1.
Students typically have about a week and a half to complete each milestone. In terms of work hours, our estimates for the individual parts are below:
This project is intended as a final project at the end of an objects-first two-semester sequence. It assumes the following material has been covered in class:
- Javadoc and UML diagrams
- Abstract structure and behavior
- Polymorphism
- Using both inheritance and composition as means of extending functionality
- Delegation model programming
- Design patterns, particularly MVC, visitor, command, factory method, and decorator
- Both writing and utilizing unit tests as an integral part of the development process
- Syntax for anonymous inner classes
It is important that this assignment be given in the context of a comprehensive instruction on object oriented programming that stresses abstract decomposition.