Once this form has been customized for your institution, you can use this button to send your lab work. Be sure to read the instructions before starting your work.
To gain experience with
As you recall from your text, the object-oriented design process involves carrying out three tasks:
1. Discovering classes. 2. Determining the responsibilities of each class. 3. Describing the relationships between classes.
When given a set of user requirements, you can determine classes by looking for nouns in a class description. Let's look at an example:
Our client, a distribution center, would like to print out a packing list for each shipment. The packing list will contain the name of the recipient, a description of each item shipped, the total quantity of each item shipped, as well as the unit cost. The packing list should also show the total number of items shipped. A sample packing list appears below:
What classes do you think can be discovered from our packing list?
Insert your answer here
Once we have discovered the classes, we now need to come up with some member functions. These can be discovered by looking for verbs in the task description.. For example, some class needs to find the price of an item. What other member functions, or behaviors, can you identify?
Once we have determined member functions, we now need to look at whether other classes are needed to perform the function. Those that are needed are called collaborators. In the next section, you will use the CRC card method to determine classes, member functions and collaborators.
The CRC card method is a good way to discover classes, member functions and collaborators. Your book provides several examples of using the CRC card method. For this exercise, you will need to develop CRC cards for a repair work order application. A typical repair work order is shown below. We have provided space for you to create CRC cards and submit these to your instructor. Please note, the number of CRC cards provided does not necessarily map exactly to the number of CRC cards required.
Date In: 07/20/2002
Date Promised: 08/20/2002
Estimated Hours: 24
Technician: D. Smith
Estimated Cost: $987
CRC Card #1 Class Name: Responsibilities: Collaborators:
CRC Card #2 Class Name: Responsibilities: Collaborators:
CRC Card #3 Class Name: Responsibilities: Collaborators:
CRC Card #4 Class Name: Responsibilities: Collaborators:
CRC Card #5 Class Name: Responsibilities: Collaborators:
CRC Card #6 Class Name: Responsibilities: Collaborators:
CRC Card #7 Class Name: Responsibilities: Collaborators:
After completing CRC cards for the repair order application, create a UML Diagram. You can do this using a word processor, such as Microsoft Word, and then paste the diagram into the text area below. Remember to use the following relationship symbols:
Insert your drawing here
There is a five part development process recommended for you to use when designing an application:
1. Gather requirements. 2. Use CRC cards to find classes, responsibilities and collaborators. 3. Use UML diagrams to record class relationships. 4. Document classes and member functions. 5. Implement your program.
In this section, you will complete an application from start to finish using this development process.
First, let's gather the requirements. This application prints out a grade report for students. A sample grade report appears below:
Grade Report
Semester: Fall 2001
Major: Chemistry
Expected Year of Graduation: 2005
Now that we have an idea of the requirements, let's complete CRC cards. Please create your CRC cards using the textareas below.
Next, create UML diagrams from the CRC cards. Use a word processor or other drawing tool and paste your UML diagram into the textarea below:
The next step in design, prior to implementation, is writing documentation for the discovered classes and member functions. Insert your documentation in the textarea below:
Insert your documentation here
Now that the design is complete, you have a framework from which to build your complete application. Paste your code in the text area below:
Insert your program here
Don't forget to send your answers when you're finished.