Component-Based & Software Reuse Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San José State University One Washington Square San José, CA 95192-0180 http://www.engr.sjsu.edu/~fayad 2003 SJSU -- CmpE
Samples of Class Diagrams Lesson 03-3: Samples of Class Diagrams 2 2003 SJSU – CmpE --- M.E. Fayad
3 Lesson Objectives Understand How to put together a class diagram Explore sample of classes and relationships Explore classes and association’s notation Understand the guidelines for putting together a class diagram 3 2003 SJSU – CmpE --- M.E. Fayad
Class Diagrams (1) The most common diagram found in modeling object-oriented system Model the static design view of a system The foundation for component diagrams deployment diagrams 4 2003 SJSU – CmpE --- M.E. Fayad
5 Class Diagrams (2) Class diagrams commonly contain the following classes interfaces collaborations dependency, generalization, and association relationship notes and constraints 5 2003 SJSU – CmpE --- M.E. Fayad
6 Class Diagram Captures the vocabulary of a system Built and refined throughout development Purpose To model the vocabulary of a system To model simple collaborations To model a logical database scheme 6 2003 SJSU – CmpE --- M.E. Fayad
Symbols for Class And Association 11 2003 SJSU – CmpE --- M.E. Fayad
Class and Association’s Notation 8 2003 SJSU – CmpE --- M.E. Fayad
Class Diagram: Example (1) 9 2003 SJSU – CmpE --- M.E. Fayad
Class Diagram: Example (2) 10 2003 SJSU – CmpE --- M.E. Fayad
Class Diagram: Example (3) 2003 SJSU – CmpE --- M.E. Fayad
Class Diagram: Example (4) 12 2003 SJSU – CmpE --- M.E. Fayad
Class Diagram: Example (5) 13 2003 SJSU – CmpE --- M.E. Fayad
Class Diagram: Example (6) 14 2003 SJSU – CmpE --- M.E. Fayad
Class Diagram: Example (7) 15 2003 SJSU – CmpE --- M.E. Fayad
Class Diagram: Example (8) 16 2003 SJSU – CmpE --- M.E. Fayad
17 Guidelines A well-structured class diagram is focused on communicating one aspect of a system’s static design view contains only elements that are essential to understanding that aspect provides detail consistent with its level of abstraction is not so minimalist that it misinforms the reader about important semantics 17 2003 SJSU – CmpE --- M.E. Fayad
18 Discussion Questions A 0..1 0..1 B A 0..1 1..1 B A 1..1 1..1 B T/F 1. Multiplicity defines how many instances of one class can be associated with the instance of the other class. 2. Bi-directional - The fact that associations are read in both directions 3. For one to one there are three possibilities: A 0..1 0..1 B A 0..1 1..1 B A 1..1 1..1 B 4. Multiplicity is the number of associations of instances of each class. 5. Class diagrams model the dynamic design view of a system. 18 2003 SJSU – CmpE --- M.E. Fayad
Questions for the Next Lectures More on Class Diagrams Software Stability Enduring Business Concepts (EBTs) Business Objects (BOs) Industrial Objects (IOs) 19 2003 SJSU – CmpE --- M.E. Fayad