1 CS 426 Senior Projects Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] February 12, 2009.

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 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.
1 CS 691z/791z Topics in Software Engineering Chapter 20: Advanced Statechart Modeling [Arlow and Neustadt, 2002] March 8, 2007.
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.
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.
COMS W4156: Advanced Software Engineering
Chapter 9 - Implementing Association Relationships1 Chapter 9 Implementing Association Relationships.
Objectives Design Class Diagrams Issues in system design Generalization Review UML papers.
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.
Y2 eProjects Session 4 – Advanced Topics. Objectives  Dynamic Models  Design Patterns (Optional)  Software testing (for S4) ACCP i7.1\Sem3_4\eProject\T4.
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,
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.
Week III  Recap from Last Week Review Classes Review Domain Model for EU-Bid & EU-Lease Aggregation Example (Reservation) Attribute Properties.
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 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.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
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, 2005] February 12, 2009

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

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 2005] 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 2005]

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 2005]

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 2005]

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 2005]

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

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 2005]

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

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

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

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] Three types of dependency Table 9.2 [Arlow & Neustadt 2005]

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

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 2005] Java code for the above example

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

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

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

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

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

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

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 2005]

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 2005]

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

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

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

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

33 Advanced generalization: powertypes Simple example of powertypes, Fig [Arlow & Neustadt 2005]