CompSci 308 Spring 2023 |
Advanced Software Design and Implementation |
This exercise asks you to start the process of designing a program before you have written the code, i.e., before you have thought about exactly how it will be implemented. The key to this process is to think about high level behavior that you would like classes to implement, i.e., that would make it easier to do the project if they already existed, while being as abstract as possible, i.e., to give your team as much room to change your minds about the implementation when you have to actually code each method.
At the end of lab, push
your team's markdown files to the doc
folder of your provided, shared, cellsociety_teamNN
repository to submit your notes about your teams' discussions.
Make sure the text of your final commit message is of the form "lab_cellsociety_plan - NetIDs".
In your Cell Society teams, complete the following activities today:
clone
the shared cellsociety_teamNN
repository to your machine and Open
the project within IntelliJFor shared Markdown editing, you can work
Examine one person's Game project (preferably one that did not use inheritance) and discuss how to create an inheritance hierarchy from the following kinds of classes to simplify other methods and clarify how to add new kinds of these objects:
For each abstraction (superclass), write the method signatures (i.e., just the header not the implementation, whether or not they are abstract
methods) needed to support all possible subclass functionalities and a comment to describe each method's purpose. The key to good design is to focus on these abstraction's behavior, i.e., methods, rather than state (instance variables). If done well, most of your code will be written using the abstractions without needing to know about specific implementation details because they are substitutable.
As a team, design this program without worrying about exactly how it will be implemented (a specific data structure, the format and location of input files, or the exact layout and OpenJFX components needed). In other words, without writing any actual implementation code, try to explore trade-offs between alternative designs and describe the best one in enough detail that another programmer has the freedom to implement it using any data structures or file format they want.
Each person should examine one of the following Cellular Automata and describe it to the rest of the team, then discuss collectively what might be common and what might vary across a typical simulation:
Discuss high level design ideas for the Cell Society project without worrying about the details (a specific data structure, the format and location of input files, or the exact layout and OpenJFX components needed). Also discuss any issues or concerns anyone has about the project's specifications or goals.
Consider the following questions:
Ideally, without any coding or requiring any specific implementation, try to explore trade-offs between several designs and to determine the best one to explore in detail (creating simplified UML style pictures can be helpful here).
After thinking about a problem generally, many people find CRC cards useful to describe a Object-Oriented design because they help show the objects more conceptually and the logical relationship between objects more explicitly, making it is easier to understand, evaluate, and modify a design. Using index cards to represent each class card nicely limits how much a class can do and easily allows you to change them and move them around to see their relationship visually. This style also helps you focus on making smart/anthropomorphic classes by answering the following questions for each:
Here are some examples of completed CRC cards. In these examples, the actions are given in English, not as a Java method signature (name, parameters, and return type). Your version must be written as a Java signature to provide more details about the flow of the program.
The following scenarios are provided to help test the completeness of your design. By writing the steps needed to complete each case below you will be able to see how effectively your design handles these scenarios and others will be able to better understand how deeply you have considered the basic issues. It may help to role play or draw a diagram of how your classes collaborate to complete each case. For this exercise each step, try to include both the class used and the method used to accomplish the step.
probCatch
, for a simulation, Fire, based on the value given in a data fileHere are some examples of completed Use Cases. In these examples, the steps are given in English, not as a Java method calls. Your version should be written as a sequence of calls to only those Java methods on your CRC cards to provide more details about the flow of the program.
To make things more interesting, pair up with another team and try to do this part using their CRC cards!