1 CS 426 Senior Projects Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2002] February 27, 2007.

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 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.
Chapter 10 Classes Continued
1 CS 426 Senior Projects Chapter 1: What is UML? Chapter 2: What is UP? [Arlow and Neustadt, 2002] January 26, 2006.
Slide 1 Chapter 10 Class and Method Design. Slide 2 REVISITING THE BASIC CHARACTERISTICS OF OBJECT-ORIENTATION.
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.
Page 1 What is the UML? UML stands for Unified Modeling Language The UML combines the best of the best from – Data Modeling concepts (Entity Relationship.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part V: Design The Design Workflow Design Classes Refining Analysis Relationships.
Lab 04.
Chapter 16 Applying UML and Patterns Craig Larman
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 03. Classes,
CS Collaborations and Hierarchies CS 4311 Chapters 5 and 6 of Wirfs-Brock, R., Wilkerson, B., and Wiener, L., Designing Object- Oriented Software,
NJIT UML Class Diagrams Chapter 16 Applying UML and Patterns Craig Larman.
Carmen David, Senior BA Business Analysis Carmen David, Senior BA Business Analysis Foundation in Business Analysis Session 7 MODELLING REQUIREMENTS.
Chapter 4: Use Case Modeling [Arlow and Neustadt, 2005] CS 790M Project preparation (II) University of Nevada, Reno Department of Computer Science & Engineering.
Object-Oriented Analysis and Design Feb 11, 2009.
2007ACS-3913 Ron McFadyen1 Class Diagram See Schaum’s UML Outline, especially chapters 4, 5, 6, 7.
Class and Sequence diagrams UML notation SE-2030 Dr. Mark L. Hornick 1.
Relationships Relationships between objects and between classes.
Chapter 13 ATM Case Study Part 2: Implementing an Object-Oriented Design Java How to Program, 8/e (C) 2010 Pearson Education, Inc. All rights reserved.
Chapter 3 Class Diagrams. 2 Outline Class Basics Class Basics Classes Classes Association Association Multiplicity Multiplicity Inheritance Inheritance.
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.
UML Class Diagram notation Indicating relationships between classes SE-2030 Dr. Mark L. Hornick 1.
Page 1  Copyright © 1997 by Rational Software Corporation Putting the UML to Work The ESU University wants to computerize their registration system –
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
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.
Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] CS 426 Senior Projects in Computer Science University of Nevada,
UNIT-IV Designing Classes – Access Layer ‐ Object Storage ‐ Object Interoperability.
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 4: Use Case Modeling
Chapter 14: Activity Diagrams
Chapter 7: Classes and Objects Chapter 8: Finding Analysis Classes
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
Chapter 19: Interfaces and Components
Presentation transcript:

1 CS 426 Senior Projects Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2002] February 27, 2007

2 Outline Relationships: Links Associations Dependencies Inheritance and Polymorphism: Generalization Class Inheritance Polymorphism

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

4 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

5.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.

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

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

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

9 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, 2002]

10 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, 2002]

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

12 Associations: Hierarchies & Networks Example of association hierarchy, Fig [Arlow and Neustadt, 2002] Example of association network, Fig [Arlow and Neustadt, 2002]

13 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 [Arlow & Neustadt, 2002]

14 Associations: Modeled using Attributes One-to-one and one-to-many associations can be modeled using attributes Fig [Arlow & Neustadt, 2002]

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

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

17 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] Four types of dependency Table 9.2 [Arlow & Neustadt, 2002]

18 Dependencies:.Definition and Types Examples of different types of dependencies Fig [Arlow and Neustadt, 2002]

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

20 Dependencies: Abstraction dependencies Abstraction dependencies are dependencies between model elements that are at different level of abstraction. Examples, Table 9.3 [Arlow & Neustadt, 2002]

21 Dependencies: Permission dependencies Permission dependencies indicate the capability of one model element to access another model element. Examples of permission dependencies: >

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

23 Inheritance: Overriding. Example of class hierarchy, Fig [Arlow & Neustadt, 2002]

24 Inheritance:.Overriding Example of overriding, Fig [Arlow & Neustadt, 2002]

25 Inheritance: Abstract Classes & Operations Example of abstract classes and operations, Fig [Arlow & Neustadt, 2002]

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

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

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

29..Polymorphism. Object diagram with polymorphism, Fig [Arlow & Neustadt, 2002]

30 …Polymorphism Another example of polymorphism, Fig [Arlow & Neustadt, 2002]