NJIT UML Class Diagrams Chapter 16 Applying UML and Patterns Craig Larman.

Slides:



Advertisements
Similar presentations
Object Design Examples with GRASP
Advertisements

Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
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.
Chapter 1 Object Oriented Analysis and Design. UML, Patterns, and Object-Oriented Analysis and Design  The essential skills for the creation of well-designed,
Oct 22, Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
March R McFadyen1 Architecture Architecture involves the set of significant decisions about the organization of a software system, decisions.
Object-Oriented Analysis and Design
Fall 2009ACS-3913 Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
Drawing System Sequence Diagrams
UML – Class Diagrams.
Copyright ©2004 Cezary Z Janikow 1 Domain Model n Visualization of entities and relationships n In UP presented as Class Diagrams – Classes, Relationships,
What is UML? A modeling language standardized by the OMG (Object Management Group), and widely used in OO analysis and design A modeling language is a.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
October 16, 2001Class Diagrams1. October 16, 2001Class Diagrams2 (Design) Class Diagrams (1) zA class diagram is a visual representation of various classes.
Feb 4, Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – (interfaces,
NJIT Drawing System Sequence Diagrams Chapter 10 Applying UML and Patterns Craig Larman Presented by Anuradha Dharani.
November Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
Objectives Explain the purpose and objectives of object- oriented design Develop design class diagrams Develop interaction diagrams based on the principles.
NJIT Designing for Visibility Chapter 19 Applying UML and Patterns Craig Larman.
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.
The Unified Modeling Language (UML) Class Diagrams.
Object-Oriented Analysis and Design
Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative Development Part III Elaboration Iteration I – Basic1.
CSSE 374: Design Class Diagrams Steve Chenoweth Office: Moench Room F220 Phone: (812) These slides and others.
Object-Oriented Design. From Analysis to Design Analysis Artifacts –Essential use cases What are the problem domain processes? –Conceptual Model What.
Objectives Design Class Diagrams Issues in system design Generalization Review UML papers.
Systems Analysis and Design in a Changing World, Fifth Edition
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.
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
Object-Oriented Analysis and Design Feb 25, 2009.
Systems Analysis and Design in a Changing World, 3rd Edition
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Introduction to Rational Rose 2000 v6.5 Copyright © 1999 Rational Software, all rights reserved 1 Rational Rose 2000 Class Diagrams.
Design Class Diagrams (DCDs)
Chapter 16 Applying UML and Patterns Craig Larman
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
Drawing System Sequence Diagrams
Object-Oriented Analysis and Design Feb 11, 2009.
Part VII: Design Continuous
Design Model Lecture p6 T120B pavasario sem.
Object-Oriented Analysis and Design Week 11, 2009.
Chapter 16: UML Class Diagrams
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
INFO 620Lecture #71 Information Systems Analysis and Design Design Class Diagrams and others INFO 620 Glenn Booker.
Chapter 16 UML Class Diagrams.
Larman chapter 101 Domain Model: Visualizing concepts Larman chapter 10.
OO Methodology Elaboration Phase Iteration 1- Part 3.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
McGraw-Hill/Irwin© 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 17 Object-Oriented Design and Modeling Using the UML.
TK2023 Object-Oriented Software Engineering CHAPTER 11 CLASS DIAGRAMS.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
BTS430 Systems Analysis and Design using UML Design Class Diagrams (ref=chapter 16 of Applying UML and Patterns)
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
11 Systems Analysis and Design in a Changing World, Fifth Edition.
Design Model: Determining Visibility CH-18. Objectives Identify four kinds of visibility. Design to establish visibility. Illustrate kinds of visibility.
1 Chapter 13: Class Diagram Chapter 19 in Applying UML and Patterns Book.
Elaboration popo.
Domain Model: Visualizing concepts
COMPONENT & DEPLOYMENT DIAGRAMS
GRASP: Visibility and Design
Chapter 11: Collaboration Diagram - PART1
Unified Modeling Language
The Object Oriented Approach to Design
Requirements To Design In This Iteration
System Sequence Diagrams
Chapter 11: Class Diagram
Chapter 16 UML Class Diagrams
Object Oriented System Design Class Diagrams
Chapter 11: Class Diagram
Design Model: Creating Design Class Diagrams
Presentation transcript:

NJIT UML Class Diagrams Chapter 16 Applying UML and Patterns Craig Larman

Objective Create design class diagrams (DCDs). Identify the classes, methods, and associations to show in a DCD.

Class Diagrams The UML has notation for showing design details in static structure. Class diagrams The definition of design class diagrams occurs within the design phase. The UML does not specifically define design class diagram. It is a design view on SW entities, rather than an analytical view on domain concepts.

Text – Figure 16-1 DCD Summary

Design Class Diagrams The creation of design class diagrams is dependent upon the prior creation of: Interaction diagrams Identifies the SW classes that participate in the solution, plus the methods of classes. Conceptual model Adds detail to the class definitions.

When to create DCDs. Although this presentation of design class diagrams follows the creation of interaction diagrams, in practice they are usually created in parallel.

Example of a DCD.

As we can see…. A design class diagram illustrates the specifications for SW classes and interfaces. Typical information included:  Classes, associations, and attributes  Interfaces, with their operations and constants  Methods  Attribute type information  Navigability  Dependencies

How to make a DCD. Identify all the classes participating in the SW solution by analyzing the interaction diagrams. Draw them in a class diagram. Duplicate the attributes from the associated concepts in the conceptual model. Add method names by analyzing the interaction diagrams. Add type information to the attributes and methods.

Continue… Add the associations necessary to support the required attribute visibility. Add navigability arrows to the associations to indicate the direction of attribute visibility. Add dependency relationship lines to indicate non-attribute visibility.

Domain model Vs. DCD

Creating the NextGen POS DCD. Identify SW classes and illustrate them. Register Sale ProductCatalog ProductSpecification Store SalesLineItem Payment

Software Classes Draw a class diagram for these classes. Include the attributes previously identified in the domain model.

Add method name Method names from interaction diagrams

Methods……

Method names: issues The following special issues must be considered with respect to method names: Interpretation of the create() message. Depiction of accessing methods. Interpretation of messages to multi-objects. Language-dependent syntax.

Method names: create The create message is the UML language independent form to indicate instantiation and initialization. When translating the design to an OOPL it must be expressed in terms of its idioms for instantiation and initialization.

Method names: Accessing methods Accessing methods are those which retrieve (accessor method - get) or set (mutator method) attributes. It is common idiom to have an accessor and mutator for each attribute, and to declare all attribute private (to enforce encapsulation).

Method names: Multi-objects A message to a multi-object is interpreted as a message to the container/collection object.

Message to a Multi-objects Java’s map, C++’s map, Smalltalk’s dictionary.

Method names: Language dependent syntax The basic UML format for methods: methodName(parameterList)

Adding more type information The type of the attributes, method parameters, and method return values may all optionally be shown.

Continue….. The design class diagram should be created by considering the audience. If it is being created in a CASE tool with automatic code generation, full and exhaustive details are necessary. If it is being created for SW developers to read, exhaustive low-level detail may adversely effect the noise-to-value ratio.

Continue…

Adding associations and navigability Navigability is a property of the role which indicates that it is possible to navigate uni-directionally across the association from objects of the source to target class. Navigability implies visibility. Most, if not all, associations in design-oriented class diagrams should be adorned with the necessary navigability arrows.

Showing navigability, or attribute visibility.

Association with navigability Define an association with a navigability adornment from A to B: A sends a message to B. A creates an instance B. A needs to maintain a connection to B.

Navigability from CDs. Navigability is Identified from Interaction Diagrams.

Associations with navigability adornments

Adding dependency relationships Dependency relationship indicates that one element (of any kind, including classes, use cases, and so on) has knowledge of another element. A dependency is a using relationship that states a change in specification of one thing may affect another thing that uses it, but not necessarily the reverse.

Continue… The dependency relationship is useful to depict non-attribute visibility between classes. Parameters Global or local visibility A dashed arrow line A dashed directed line

Dependency relationships non-attribute visibility

Notation for member details

Member details in the POS class diagram

Notation for method bodies in DCDs.

Interfaces The UML has several ways to show interface implementations. Since both the socket line notation and the dependency line notation used curved lines not common in drawing tools, most people use a dependency arrow and the «interface» stereotype.

Interface Example «interface» Timer getTime() Clock1 getTime( )

UML stereotypes UML uses stereotypes encapsulated in guillemots (« and », not > ) to extend many diagram symbols. Guillemots can be found in the latin-1 symbol set in Windows Insert Symbol command) Examples: «interface» «extends» «includes» «actor» «creates»

Association An association is a structural relationship that specifies that objects of one thing are connected to objects of another.

Navigation Navigability is a property of the role which indicates that it is possible to navigate uni- directionally across the association from objects of the source to target class. Navigability implies visibility.

Dependency A dependency is a using relationship, specifying that a change in the specification of one thing may affect another thing that uses it.

Generalization A generalization is a relationship between a general thing (called the super class or parent) and a more specific kind of that thing (called the subclass or child). is-a-kind-of relationship.

Aggregation Whole/part relationship Has-a relationship

Realization A realization is a semantic relationship between classifiers in which one classifier specifies a contract that another classifier guarantees to carry out. We use realization in two circumstances: In the context of interfaces. In the context of collaborations.

Phases Inception The Design Model and DCDs will not usually be started until elaboration because it involves detailed design decisions, which are premature during inception.

Continue… Elaboration During this phase, DCDs will accompany the UC realization interaction diagrams; they may be created for the most architecturally significant classes of the design. CASE tools can reverse-engineer (generate) DCDs from source code.

Continue… Construction DCDs will continue to be generated from the source code as an aid in visualizing the static structure of the system.

UP Artifacts