1 / 10

CONCEPTUAL DESIGN: UML CLASS DIAGRAM RELATIONSHIPS

CONCEPTUAL DESIGN: UML CLASS DIAGRAM RELATIONSHIPS. Objects. Objects have three responsibilities:. What they know about themselves – (e.g., Attributes) What they do – (e.g., Operations) What they know about other objects – (e.g., Relationships). Relationships.

abra
Download Presentation

CONCEPTUAL DESIGN: UML CLASS DIAGRAM RELATIONSHIPS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CONCEPTUAL DESIGN: UML CLASS DIAGRAM RELATIONSHIPS

  2. Objects • Objects have three responsibilities: • What they know about themselves – (e.g., Attributes) • What they do – (e.g., Operations) • What they know about other objects – (e.g., Relationships)

  3. Relationships A RELATIONSHIP is what a class or an object knows about another class or object. • Generalization (Class-to-Class) (Superclass/Subclass) • Inheritance • Ex: Person - FacultyPerson, StudentPerson, Staff... • Ex: ModesOfTravel - Airplane, Train, Auto, Cycle, Boat... • [Object] Associations • FacultyInformation - CourseInformation • StudentInformation - CourseInformation • [Object]Aggregations & Composition(Whole-Part) • Assembly - Parts • Group - Members • Container - Contents F o u r T y p e s

  4. Relationships Exist to: 1) show relationships 2) enforce integrity 3) help produce results In this example: • Removal of a University Course should also remove Students that are in the Course but not Student Information. • Removal of a Student should also remove the Courses that the Student is in but not the University Course. • Removal of a Student in a Course should not affect either University Course or Student Information. UniversityCourse 1 StudentInformation 0,m 1 StudentInCourse 0,m

  5. { Member memberNumber firstName lastName telephone address city etc... Expanded view of a Class into its three sections: Top: Class Name Middle: attributes Bottom: operations attributes { checkOutVideo checkInVideo buyItem etc... operations UML Class Diagram Notation 1 of 2 Class

  6. Object Aggregation Association Object Composition Association Object Association n n 1 1..* 0..* 0..* UML Class Diagram Notation 2 of 2 Class Generalization Relationship Will always be “1”

  7. Class Diagram Relationships • Class • Generalization • Object • Association • Aggregation • Composition

  8. Object Association Relationship Patterns Class A attributes operations Whole Whole attributes operations attributes operations Class B Class B attributes operations attributes operations Part2 Part2 Part1 Part1 PartN PartN attributes operations attributes operations attributes operations attributes operations attributes operations attributes operations Class A attributes operations b) Object Aggregation Associations x x x x x x x x c) Object Composition Associations (y may not be “1”) x 1 1 x 1 y y y a) Object Associations

  9. Associations role B Class A Class B role A Example: Employee Company Person Employer

  10. Multiplicities 1 Class exactly one many (zero or more) 0..* Class 0..1 optional (zero or one) Class m..n numerically specified Class Example: 0..* Course CourseOffering 1

More Related