Presentation is loading. Please wait.

Presentation is loading. Please wait.

Engineering 5895: Software Design 9/11/01Class Diagrams 1.

Similar presentations


Presentation on theme: "Engineering 5895: Software Design 9/11/01Class Diagrams 1."— Presentation transcript:

1 Engineering 5895: Software Design 9/11/01Class Diagrams 1

2 Engineering 5895: Software Design 9/11/01Class Diagrams 2 Perspectives Conceptual classes represent concepts in a domain software (& language) independent Specification classes represent interfaces (or types) Implementation full classes automatic code generation

3 Engineering 5895: Software Design 9/11/01Class Diagrams 3 Interface vs Implementation Not well distinguished by current OOP languages Classes (particularly in C++) combine the two Design Rule #1 Program to the interface, not the implementation

4 Engineering 5895: Software Design 9/11/01Class Diagrams 4 A Class Diagram

5 Engineering 5895: Software Design 9/11/01Class Diagrams 5 A Class Diagram Associations

6 Engineering 5895: Software Design 9/11/01Class Diagrams 6 Associations Relationships between instances of classes Conceptual perspective  conceptual relation Specification perspective  responsibility Implementation imply specifics (e.g. pointers)

7 Engineering 5895: Software Design 9/11/01Class Diagrams 7 A Class Diagram Generalization

8 Engineering 5895: Software Design 9/11/01Class Diagrams 8 A Class Diagram Abstract class represented by italicised name

9 Engineering 5895: Software Design 9/11/01Class Diagrams 9 Multiplicities Mandatory At each end 0..1 0..* 1..* 1,3,9..11 Multiplicities

10 Engineering 5895: Software Design 9/11/01Class Diagrams 10 Multiplicities

11 Engineering 5895: Software Design 9/11/01Class Diagrams 11 Role Names

12 Engineering 5895: Software Design 9/11/01Class Diagrams 12 Role Names Are optional May go at either (or both) end(s) Alternatively, association itself may be named Bleah! Only name roles when it adds clarity

13 Engineering 5895: Software Design 9/11/01Class Diagrams 13 Role Names

14 Engineering 5895: Software Design 9/11/01Class Diagrams 14 Multiple associations Second association saying department has one head who is a professor (and prof can only be head of one department)

15 Engineering 5895: Software Design 9/11/01Class Diagrams 15 Directed associations New association is directed, meaning it can only be navigated from department to prof. E.g. department is supposed to know who its head is but prof doesn't have to know he/she is head.

16 Engineering 5895: Software Design 9/11/01Class Diagrams 16 Direction No arrowheads means either directionality is unspecified navigability is in both directions I prefer unspecified (except, perhaps in implementation perspective)

17 Engineering 5895: Software Design 9/11/01Class Diagrams 17 Attributes What is difference between attribute and association? Often none At implementation, association will often imply a pointer from one class to the other Use attributes for primitive, wholly contained data (integers, strings)


Download ppt "Engineering 5895: Software Design 9/11/01Class Diagrams 1."

Similar presentations


Ads by Google