CS 426 Senior Projects Chapter 9: Relationships

Slides:



Advertisements
Similar presentations
Stereotypes Stereotypes provide the capability to create a new kind of modeling element. –They can be used to classify or mark modeling elements. –A type.
Advertisements

Activity Diagrams [Arlow and Neustadt, 2005] CS 425 / 625 Seminar on Software Engineering University of Nevada, Reno Department of Computer Science & Engineering.
Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes [Arlow and Neustadt, 2005] CS 426/CPE 426 Senior Projects University of Nevada, Reno.
1 CS 426 Senior Projects Chapter 4: Use Case Modeling [Arlow and Neustadt, 2002] February 8, 2007.
1 CS 426 Senior Projects Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] February 12, 2009.
1 CS 426 Senior Projects Chapter 19: Interfaces and Components [Arlow & Neustadt 2005] February 28, 2008.
1 CS 426/CPE 426 Senior Projects Chapter 5: Advanced Use Case Modeling [Arlow and Neustadt, 2002] February 13, 2007.
1 CS 426 Senior Projects Chapter 7: Classes and Objects & Chapter 8: Finding Analysis Classes [Arlow and Neustadt, 2002] February 14, 2006.
1 CS 426 Senior Projects Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2002] February 27, 2007.
1 CS 426 Senior Projects Chapter 14: Activity Diagrams [Arlow and Neustadt, 2005] February 17, 2009.
Page 1  Copyright © 1997 by Rational Software Corporation Class Diagrams A class diagram shows the existence of classes and their relationships in the.
1 CS/CPE 426 Senior Projects Chapter 21: State Machines Chapter 22:Advanced State Machines [Arlow and Neustadt 2005] March 24, 2009.
1/31 CS 426 Senior Projects Chapter 1: What is UML? Chapter 2: What is UP? [Arlow and Neustadt, 2005] January 22, 2009.
1 CS 426 /CPE 426 Senior Projects Chapter 7: Classes and Objects & Chapter 8: Finding Analysis Classes [Arlow and Neustadt, 2005] February 19, 2008.
1 CS 426/CPE 426 Senior Projects Chapter 5: Advanced Use Case Modeling [Arlow and Neustadt, 2005] February 14, 2008.
1 CS 426 Senior Projects Chapter 4: Use Case Modeling [Arlow and Neustadt, 2005] February 5, 2009.
1 CS 691z / 791z Topics on Software Engineering Chapter 17: Interfaces and Subsystems [Arlow & Neustadt, 2002] March 6, 2007.
1 CS 426 Senior Projects Chapter 1: What is UML? Chapter 2: What is UP? [Arlow and Neustadt, 2002] January 26, 2006.
Relationships. In the Interaction diagrams, we began to look at how classes communicate with one another. Now, we'll focus on the relationships between.
Objectives Design Class Diagrams Issues in system design Generalization Review UML papers.
Lab 04.
Chapter 16 Applying UML and Patterns Craig Larman
NJIT UML Class Diagrams Chapter 16 Applying UML and Patterns Craig Larman.
Chapter 4: Use Case Modeling [Arlow and Neustadt, 2005] CS 790M Project preparation (II) University of Nevada, Reno Department of Computer Science & Engineering.
2007ACS-3913 Ron McFadyen1 Class Diagram See Schaum’s UML Outline, especially chapters 4, 5, 6, 7.
Week III  Recap from Last Week Review Classes Review Domain Model for EU-Bid & EU-Lease Aggregation Example (Reservation) Attribute Properties.
Relationships Relationships between objects and between classes.
Chapter 19: Interfaces and Components [Arlow and Neustadt, 2005] University of Nevada, Reno Department of Computer Science & Engineering.
Chapter 14: Activity Diagrams November 2015 [Arlow and Neustadt, 2005] CS 425/625 Senior Projects University of Nevada, Reno Department of Computer Science.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] CS 426 Senior Projects in Computer Science University of Nevada,
Java Programming: Guided Learning with Early Objects Chapter 9 Inheritance and Polymorphism.
UNIT-IV Designing Classes – Access Layer ‐ Object Storage ‐ Object Interoperability.
Object-Oriented Modeling
The Movement To Objects
What is UML? What is UP? [Arlow and Neustadt, 2005] October 5, 2017
Interface, Subclass, and Abstract Class Review
Collaborations and Hierarchies
Communication DIAGRAM
UML SEQUENCE AND CLASS DIAGRAMS
Chapter 19: Interfaces and Components
UML Class Diagrams: Basic Concepts
UML Activity Diagrams & State Charts
Chapter 18: Refining Analysis Relationships
CS/CPE 426 Senior Projects
Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes
IMAT5205 Systems Analysis and Design
Chapter 4: Use Case Modeling
Chapter 14: Activity Diagrams
Chapter 20 Object-Oriented Analysis and Design
Object-Oriented Knowledge Representation
Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes
Analysis models and design models
Communication DIAGRAM
Chapter 19: Interfaces and Components
CS/CPE 426 Senior Projects
Chapter 11: Class Diagram
Chapter 19: Interfaces and Components
Chapter 14: Activity Diagrams
Chapter 4: Use Case Modeling
Chapter 14: Activity Diagrams
CS 791Z State Machines & Advanced State Machines
Object Oriented System Design Class Diagrams
Interfaces and Components
Jim Fawcett CSE687 – Object Oriented Design Spring 2014
Systems Analysis and Design with UML Version 2.0, Second Edition
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Chapter 19: Interfaces and Components
Presentation transcript:

CS 426 Senior Projects Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] February 21, 2012

Outline Relationships: Inheritance and Polymorphism: Links Associations Dependencies Inheritance and Polymorphism: Generalization Class inheritance Polymorphism Advanced generalization

Relationships: Links & Associations Relationships = semantic connections between modeling elements Links = connections between objects Associations = connections between classes Links are instances of associations

Links.. A link is a connection between objects that communicate via messages Links can be: Unidirectional, if only one object (the source) contains a reference to the other (the target). Navigability is shown by an arrowhead at the target end of the link. Bidirectional, if both objects have a reference to the other. Bidirectional links are shown using unadorned lines with no arrowheads. Object diagrams show objects and their relationships at some point in time. Thus, links are dynamic connections between objects

.Links. Example of object diagram, Fig. 9.2 [Arlow & Neustadt 2002]. It shows objects, links, and roles. It also illustrates the “oblique” style of drawing paths in UML diagrams.

..Links Example of unidirectional link, Fig. 9.3 [Arlow & Neustadt 2005] The “orthogonal” style of drawing paths in UML diagrams, Fig. 9.4 [Arlow & Neustadt 2002]

Associations: Semantics Associations are relationships between classes Links depend on associations, and instantiate them Fig. 9.5 [Arlow & Neustadt 2002]

Associations: Syntax The syntax for an association includes: Association name Role names Multiplicity Navigability Example of association, Fig. 9.6 [Arlow & Neustadt 2005]

Associations: Multiplicity.. Multiplicity constrains the number of objects of a class that can be involved in a given relationship at any point in time Fig. 9.8 [Arlow & Neustadt 2005]

Associations: .Multiplicity. There is no default value for multiplicity in UML. If not specified, multiplicity is undecided Examples of multiplicity syntax, Table 9.1 [Arlow & Neustadt 2005]

Associations: ..Multiplicity Multiplicity constraints encode business rules of the model It is important to “read the model as written” Figure 9.9 [Arlow & Neustadt 2005]

Associations: Hierarchies & Networks Example of association hierarchy, Fig. 9.11 [Arlow and Neustadt 2005] network, Fig. 9.12

Associations: Navigability Navigability can be read “messages can only be sent in the direction of the arrow” Relationships without arrows are bidirectional Unidirectional associations reduce coupling between classes Fig. 9.13 [Arlow & Neustadt 2005]

Associations: Modeled using Attributes One-to-one and one-to-many associations can be modeled using attributes Fig. 9.16 [Arlow & Neustadt 2005]

Associations: Association Classes. Many-to-many associations can lead to association classes Example of many-to-many association, Fig. 9.18 [Arlow & Neustadt 2005] Corresponding association class, Fig. 9.19 [Arlow & Neustadt 2005]

Associations: .Association Classes However, many-to-many associations can also be modeled using regular classes, e.g., Fig. 9.20 [Arlow & Neustadt 2005]

Dependencies: Definition and Types. “A dependency is a relationship between two elements where a change to one element (the supplier) may affect or supply information needed by the other element (the client)” [Rumbaugh et al., The UML Reference Manual] Three types of dependency Table 9.2 [Arlow & Neustadt 2005]

Dependencies: .Definition and Types Examples of different types of dependencies Fig. 9.23 [Arlow and Neustadt 2005]

Dependencies: Usage dependencies The <<use>> dependencies are the most common type of dependency. They state that the client makes use of the supplier in some way. Example, Fig. 9.24 [Arlow & Neustadt 2005] Java code for the above example

Dependencies: Abstraction dependencies Abstraction dependencies are dependencies between model elements that are at different level of abstraction: <<trace>>, <<substitute>>, <<refine>> and <<derive>> Examples for <<derive>> Table 9.3 [Arlow & Neustadt 2005]

Dependencies: Permission dependencies Permission dependencies indicate the capability of one model element to access another model element. Examples of permission dependencies: <<access>> <<import>> <<permit>> (formerly <<friend>>)

Generalization Generalization applies to all classifiers and to some other elements such as associations, states, and events Example of generalization, Fig. 10.2 [Arlow & Neustadt 2005]

Inheritance: Overriding. Example of class hierarchy, Fig. 10.3 [Arlow & Neustadt 2005]

Inheritance: .Overriding Example of overriding, Fig. 10.4 [Arlow & Neustadt 2005]

Inheritance: Abstract Classes & Operations Example of abstract classes and operations, Fig. 10.5 [Arlow & Neustadt 2005]

Inheritance: Level of Abstraction In generalization hierarchies it is important to maintain a uniform level of abstraction at each level Incorrect example, Fig. 10.6 [Arlow & Neustadt 2005]

Polymorphism… Polymorphism means “many forms”. A polymorphic operation has several different implementations Example of polymorphism, Fig. 10.7 [Arlow & Neustadt, 2002]

.Polymorphism.. Example of polymorphism “in action,” Fig. 10.8 [Arlow & Neustadt 2005]

..Polymorphism. Object diagram with polymorphism, Fig. 10.9 [Arlow & Neustadt 2005]

…Polymorphism Another example of polymorphism, Fig. 10.10 [Arlow & Neustadt 2005]

Advanced generalization: generalization sets. An example of generalization set, Figs. 10.11 & 10.12 [Arlow & Neustadt 2005]

Advanced generalization: .generalization sets Constraints on generalization sets Table 10.1 and Fig. 10.14 [Arlow & Neustadt 2005]