Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] CS 426 Senior Projects in Computer Science University of Nevada,

Slides:



Advertisements
Similar presentations
UML (cont.) “The Unified Modeling Language User Guide” by G. Booch, J. Rumbaugh and I. Jacobson ● Classes ● Relationships ● Class diagrams ● Examples.
Advertisements

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.
Activity Diagrams [Arlow and Neustadt, 2005] CS 425 / 625 Seminar on Software Engineering University of Nevada, Reno Department of Computer Science & Engineering.
Chapter 5: Advanced Use Case Modeling [Arlow and Neustadt, 2005] CS 426/CPE 426 Senior Projects University of Nevada, Reno Department of Computer Science.
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 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 Senior Projects Chapter 7: Classes and Objects & Chapter 8: Finding Analysis Classes [Arlow and Neustadt, 2002] February 14, 2006.
Chapter 5: Advanced Use Case Modeling [Arlow and Neustadt, 2005] CS 426/CPE 426 Senior Projects University of Nevada, Reno Department of Computer Science.
1 CS 426 Senior Projects Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2002] February 27, 2007.
1 CS/CPE 426 Senior Projects Chapter 21: State Machines Chapter 22:Advanced State Machines [Arlow and Neustadt 2005] March 24, 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 691z / 791z Topics on Software Engineering Chapter 17: Interfaces and Subsystems [Arlow & Neustadt, 2002] March 6, 2007.
Slide 1 Chapter 10 Class and Method Design. Slide 2 REVISITING THE BASIC CHARACTERISTICS OF OBJECT-ORIENTATION.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
Unified Modeling Language
Object-Oriented Analysis and Design
Relationships. In the Interaction diagrams, we began to look at how classes communicate with one another. Now, we'll focus on the relationships between.
Chapter 9 - Implementing Association Relationships1 Chapter 9 Implementing Association Relationships.
Objectives Design Class Diagrams Issues in system design Generalization Review UML papers.
What is UML? What is UP? [Arlow and Neustadt, 2005] January 23, 2014
Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes [Arlow and Neustadt, 2005] CS 426 Senior Projects in Computer Science University of.
Lawrence ChungCS6359.0T1: Module 41 Module 4: Relationships.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 10: Class and Method.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part V: Design The Design Workflow Design Classes Refining Analysis Relationships.
Lab 04.
University of Toronto Department of Computer Science © Steve Easterbrook. This presentation is available free for non-commercial use with attribution.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
Chapter 16 Applying UML and Patterns Craig Larman
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 10: Class and Method.
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.
Relationships Relationships between objects and between classes.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Chapter 19: Interfaces and Components [Arlow and Neustadt, 2005] University of Nevada, Reno Department of Computer Science & Engineering.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Chapter 14: Activity Diagrams November 2015 [Arlow and Neustadt, 2005] CS 425/625 Senior Projects University of Nevada, Reno Department of Computer Science.
UML Class Diagram notation Indicating relationships between classes SE-2030 Dr. Mark L. Hornick 1.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
Chapter 6: The Analysis Workflow Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes [Arlow and Neustadt, 2005] CS 426 Senior Projects in.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
Teanna Clarke 6aQ What is a Entity-Relationship Diagram?  An Entity-Relationship Diagram (ERD) is a tool that graphically shows the connections among.
UNIT-IV Designing Classes – Access Layer ‐ Object Storage ‐ Object Interoperability.
Chapter 16: The Design Workflow Chapter 17: Design Classes
What is UML? What is UP? [Arlow and Neustadt, 2005] October 5, 2017
Chapter 4: Use Case Modeling
Chapter 19: Interfaces and Components
CS 426 Senior Projects Chapter 9: Relationships
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
Chapter 5: Advanced Use Case Modeling
Chapter 4: Use Case Modeling
Chapter 14: Activity Diagrams
Object-Oriented Knowledge Representation
Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes
Analysis models and design models
Chapter 19: Interfaces and Components
CS/CPE 426 Senior Projects
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
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:

Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] CS 426 Senior Projects in Computer Science University of Nevada, Reno Department of Computer Science & Engineering

2  Relationships Links Associations Dependencies  Inheritance and Polymorphism Generalization Class inheritance Polymorphism Advanced generalization

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

4  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). Bidirectional, if both objects have a reference to the other  Object diagrams show objects and their relationships at some point in time. Thus, links are dynamic connections between objects

5  Example of object diagram, that shows objects, links, and roles. It also illustrates the oblique style of drawing paths in UML diagrams.

6 Example of unidirectional link The orthogonal style of drawing paths in UML diagrams

7  Associations are relationships between classes  Links depend on associations, and instantiate them

8  The syntax for an association includes:  Association name  Role names  Multiplicity  Navigability

9  Multiplicity constrains the number of objects of a class that can be involved in a given relationship at any point in time

10  There is no default value for multiplicity in UML. If not specified, multiplicity is undecided

11  Multiplicity constraints encode business rules of the model  It is important to “read the model as written”

12 Example of association hierarchy Example of association network

13  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

14  One-to-one and one-to-many associations can be modeled using attributes

15 Many-to-many associations can lead to association classes Corresponding association class

16  However, many-to-many associations can also be modeled using regular classes

17  “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

18  Examples of different types of dependencies

19  The > dependencies are the most common type of dependency. They state that the client makes use of the supplier in some way. Java code for the above example

20  Abstraction dependencies are dependencies between model elements that are at different level of abstraction: >, >, > and >

21  Permission dependencies indicate the capability of one model element to access another model element.  Examples of permission dependencies: > > (formerly >)

22  Generalization applies to all classifiers and to some other elements such as associations, states, and events

23  Example of class hierarchy

24  Example of overriding

25  Example of abstract classes and operations

26  In generalization hierarchies it is important to maintain a uniform level of abstraction at each level  Incorrect example

27  Polymorphism means “many forms”. A polymorphic operation has several different implementations

28  Example of polymorphism “in action”

29  Object diagram with polymorphism

30  Another example of polymorphism

31  An example of generalization set

32  Constraints on generalization sets