Design Model: Determining Visibility CH-18. Objectives Identify four kinds of visibility. Design to establish visibility. Illustrate kinds of visibility.

Slides:



Advertisements
Similar presentations
PHP functions What are Functions? A function structure:
Advertisements

Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
Object Design Examples with GRASP
Visibility Larman, Chapter 19 (with ideas from George Blank of NJIT) CSE432 Object Oriented Software Engineering.
Jan 23, Ron McFadyen1 SSD for a samplePOS Use Case Figure 13.1 Input Events invoke a system operation of the same name same idea as in object-oriented.
Sept Ron McFadyen Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together.
Oct Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object.
Oct 22, Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
March Ron McFadyen1 Ch 17: Use Case Realizations with GRASP Patterns Assigning responsibilities to objects to achieve user goals Section 17.4.
Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together to achieve some functionality.
Fall 2009AXS-3913 Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object.
Sept Ron McFadyen Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together.
Oct Ron McFadyen1 Ch 17: Use Case Realizations with GRASP Patterns P. 248: “The assignment of responsibilities and design of collaborations.
Fall 2009ACS-3913 Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
Copyright W. Howden1 Lecture 7: Functional and OO Design Descriptions.
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
Sept Ron McFadyen Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together.
Oct Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object.
Feb 4, Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – (interfaces,
Feb Ron McFadyen1 Use Case Realizations with GRASP Patterns “The assignment of responsibilities and design of collaborations are very important.
November Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
Object-Oriented Analysis and Design
NJIT Designing for Visibility Chapter 19 Applying UML and Patterns Craig Larman.
November Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object.
Lecture 7: UML Class Diagrams CSE 111 7/15/20151Copyright W. Howden.
Designing with Interaction and Design Class Diagrams Chapters 15 & 16 Applying UML and Patterns Craig Larman With some ideas from students in George Blank’s.
Object-Oriented Analysis and Design
Object-Oriented Design. From Analysis to Design Analysis Artifacts –Essential use cases What are the problem domain processes? –Conceptual Model What.
Object Oriented Software Development
Chapter 18 Object Design Examples with GRASP. Objectives Design use case realizations –A use-case realization describes how a particular use case is realized.
Interaction diagrams Sequence and collaboration diagrams.
1 Chapter 3 and 6– Classes, Objects and Methods Object-Oriented Programming Concepts – Read it from Java TutorialJava Tutorial Definition: A class is a.
1 Ch 18. Object Design Examples With Grasp Objectives Design use case realizations. Apply GRASP to assign responsibilities to classes. Apply UML to illustrate.
Introduction To System Analysis and Design
Object-Oriented Analysis and Design An Introduction.
Object Design Examples with GRASP (Ch. 18)
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 9: Interaction.
Design Class Diagrams (DCDs)
Chapter 16 Applying UML and Patterns Craig Larman
NJIT UML Class Diagrams Chapter 16 Applying UML and Patterns Craig Larman.
An Object-Oriented Approach to Programming Logic and Design Chapter 3 Using Methods and Parameters.
Chapter 10 Classes and Objects In-Depth. Chapter 10 A class provides the foundation for creating specific objects, each of which shares the general attributes,
Object-Oriented Analysis and Design Week 11, 2009.
GRASP: Designing Objects With Responsibilities
OO Methodology Elaboration Phase Iteration 1- Part 3.
Design. 2 The Need for Software Blueprints Knowing an object-oriented language and having access to a library is necessary but not sufficient in order.
Chapter 7 Classes and Methods III: Static Methods and Variables Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition)
Use-Case Model: Adding Detail with Operation Contracts.
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
Ch 17: Use Case Realizations with GRASP Patterns
Mapping Designs to Code. It specify how to map the design into object oriented language The UML artifacts created during the design work, the interaction.
 Sequence Diagrams Introduction.  Sequence Diagrams  Review Schedule Sheridan.
Object Design Examples with GRASP
GRASP: Visibility and Design
Chapter 11: Collaboration Diagram - PART1
Communication DIAGRAM
Using local variable without initialization is an error.
Requirements To Design In This Iteration
Chapter 10: Visibility Chapter 18 in Applying UML and Patterns Book.
Chapter 20 Applying UML and Patterns Craig Larman
IMAT5205 Systems Analysis and Design
Communication DIAGRAM
Chapter 11: Class Diagram
Chapter 16 UML Class Diagrams
Object Oriented System Design Class Diagrams
Implementation Model: Mapping Designs to Code
Chapter 11: Class Diagram
UML Interaction Diagrams
Design Model: Creating Design Class Diagrams
Presentation transcript:

Design Model: Determining Visibility CH-18

Objectives Identify four kinds of visibility. Design to establish visibility. Illustrate kinds of visibility in the UML notation.

Visibility is the ability of one object to see or have reference to another.

Visibility Between Objects The designs created for the system events (enterItem, etc.) illustrate messages between objects. For a sender object to send a message to a receiver object, the sender must be visible to the receiver the sender must have some kind of reference or pointer to the receiver object.

Visibility Between Objects For example, the getSpecification message sent from a Register to a ProductCatalog implies that the ProductCatalog instance is visible to the Register instance

Visibility Between Objects The UML has special notation for illustrating visibility When creating a design of interacting objects, it is necessary to ensure that the necessary visibility is present to support message interaction

Visibility There are four common ways that visibility can be achieved from object A to object B: Attribute visibility—B is an attribute of A. Parameter visibility—B is a parameter of a method of A. Local visibility—B is a (non-parameter) local object in a method of A. Global visibility—B is in some way globally visible.

Attribute Visibility Attribute visibility from A to B exists when B is an attribute of A. It is a relatively permanent visibility because it persists as long as A and B exist. This is a very common form of visibility in object-oriented systems.

Attribute Visibility For ex. in a Java class definition for Register, a Register instance may have attribute visibility to a ProductCatalog, since it is an attribute (Java instance variable) of the Register. This visibility is required because in the enterItem diagram, a Register needs to send the getSpecification message to a ProductCatalog:

Parameter Visibility Parameter visibility from A to B exists when B is passed as a parameter to a method of A. It is a relatively temporary visibility because it persists only within the scope of the method. After attribute visibility, it is the second most common form of visibility in object-oriented systems.

Parameter Visibility when the makeLineItem message is sent to a Sale instance, a ProductSpecification instance is passed as a parameter. Within the scope of the makeLineItem method, the Sale has parameter visibility to a ProductSpecification (see Figure 18.3).

Parameter Visibility It is common to transform parameter visibility into attribute visibility.

Parameter to attributeVisibility when the Sale creates a new SalesLineItem, it passes a ProductSpecifi-cation in to its initializing method (in C++ or Java, this would be its constructor). Within the initializing method, the parameter is assigned to an attribute, thus establishing attribute visibility (Figure 18.4).

Local Visibility Local visibility from A to B exists when B is declared as a local object within a method of A. It is a relatively temporary visibility because it persists only within the scope of the method. After parameter visibility, it is the third most common form of visibility in object-oriented systems.

Local Visibility Two common means by which local visibility is achieved are: Create a new local instance and assign it to a local variable. Assign the returning object from a method invocation to a local variable.

Local Visibility

Global Visibility Global visibility from A to B exists when B is global to A. It is a relatively permanent visibility because it persists as long as A and B exist. It is the least common form of visibility in object-oriented systems.

Global Visibility One way to achieve global visibility is to assign an instance to a global variable, which is possible in some languages, such as C++, but not others, such as Java.

Illustrating Visibility in the UML Collaboration diagram (optional)