160 likes | 486 Views
ZEIT2301 Design of Information Systems Structural Design: CRC Cards. School of Engineering and Information Technology UNSW@ADFA Dr Kathryn Merrick. Topic 05: CRC Cards. Overview To look at ways to construct class and object diagrams Class-Responsibility-Collaboration Cards
E N D
ZEIT2301Design of Information SystemsStructural Design: CRC Cards School of Engineering and Information Technology UNSW@ADFA Dr Kathryn Merrick
Topic 05: CRC Cards • Overview • To look at ways to construct class and object diagrams • Class-Responsibility-Collaboration Cards Reference: Text Ch 6.
“Discovering” classes How do you “discover” the: classes, attributes, and operations that are relevant for your problem domain? Four approaches: Textual analysis Brainstorming Pattern review CRC cards 3
1. Textual Analysis Perform textual analysis on the Use Case descriptions Nouns suggest classes Verbs suggest operations 4
2. Brainstorming Brainstorm additional candidate classes using common object lists from a similar business domain. Look for tangible things (patients, doctors, medical records files, etc) Look for events that occur in the business domain (appointments, medical procedures, etc) Look for interactions (e.g. patient paying a bill). The “bill” could be a class. But remember that “paying the bill” is a process (typically a relationship between classes, not a class itself). 5
3. Pattern Review A pattern is a useful group of collaborating classes that provide a solution to commonly occurring problems. e.g. many business transactions involve the same type of objects and interactions. So re-use rather than re-invent. Patterns have been developed (and published) for some common business domains (e.g. accounting) Some are high-level business patterns, others are low-level implementation patterns 6
4. CRC cards Class-Responsibility-Collaboration CRC cards are used to document the: responsibilities collaborationsof a class CRC cards help understand/document the classes to be modelled in a class diagram Note: CRC cards are not part of UML 7
Responsibilities & Collaboration Responsibilities of a class Knowing: things an instance of a class knows (i.e. the value of its attributes and its relationships) Doing: things that instances of a class can do (i.e. execute its operations) Collaboration Most business functions (i.e. use cases) involve several classes collaborating An objectsends a messages to request a service from another object eg a Patient object requests the creation of an Appointment object 8
Exercise • Spend a few minutes studying the model on the next slide. • Look for: • Attributes • Operations • Relations: • Generalization • Aggregation • Association classes • Note the recursive relationship • Visibility • Multiplicities 11 c
Session 2, 2010 12 Fig 6.2