|
|
FHTW Berlin |
How do we pick candidate classes out of a description? Grady Booch suggested the following method:
The blue words are all candidate classes - they will not all be classes, but they are candidates. Take a lot of pieces of paper or cards (not too small), and write each noun at the top of one of the pieces of paper and draw a line all across the paper underneath the word.
The red words make good methods - they just need to be assigned to classes. Divide the rest of the paper in two pieces - write the verbs on the bottom part. Decorate with attributes as deemed necessary, which get written on the top piece.
The green words can be attributes or relationships - distribute them accordingly.
Does your diagram make sense? Resort the cards and the methods, making new cards and ripping up the old ones, until finally your diagram seems to be consistent.
But wait - we are going to simulate a real-world situation. You are not going to design classes for your own materials, but for those of another group. The groups of two and the groups of three organize a ring-swap (not an exchange). Is anything unclear in the diagrams you get? Note this down in your report - and ask the group for clarification!
Make a list of all class candidates from the use cases and the sequence diagrams. Evaluate their suitability for classes based on the following criteria:
Feel free to introduce new classes! Make a list of candidate methods - include setter and getter methods for important information. Assign the methods to the classes selected.
Now draw a class diagram using a UML-Tool including attributes and associations. Upload your report including the class diagram and the time needed to complete the exercise to the exercise area of Moodle by midnight of the day before your next exercise session.