Chapter 16 Applying UML and Patterns Craig Larman

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

Inheritance Inheritance Reserved word protected Reserved word super
Oct 22, Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
Object-Oriented Analysis and Design
Fall 2009ACS-3913 Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
UML – Class Diagrams.
Design Patterns in Java Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
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.
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.
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
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
UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software.
Mapping Designs to Code Larman, Chapter 20 CSE432 Object Oriented Software Engineering.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part V: Design The Design Workflow Design Classes Refining Analysis Relationships.
Object-Oriented Analysis and Design Feb 25, 2009.
1 Forward and Reverse Engineering. 2 The UML is not just an OO modeling language. It also permits forward engineering (FE) and reverse engineering (RE).
Systems Analysis and Design in a Changing World, 3rd Edition
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Real Time Systems Modeling Structure in UML (Part I)
Design Class Diagrams (DCDs)
1 Class Diagrams: Advanced Concepts. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are the most commonly used diagrams.
UML Diagrams: The Static Model Class Diagrams. The Static Model Define the static structure of the logical model Represent classes, class hierarchies.
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.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Advanced UML Class Diagrams.
NJIT UML Class Diagrams Chapter 16 Applying UML and Patterns Craig Larman.
An Introduction to the Unified Modeling Language
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Part VII: Design Continuous
Design Model Lecture p6 T120B pavasario sem.
1 Introduction to Classes. 2 Terms and Concepts A class is... –The most important building block of any object- oriented system. –A description of a set.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
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.
OO Methodology Elaboration Phase Iteration 1- Part 3.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
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)
11 Systems Analysis and Design in a Changing World, Fifth Edition.
Software Modelling Class Diagram. Class Diagrams The main building block in object oriented modeling They are used both for general conceptual modeling.
1 Chapter 13: Class Diagram Chapter 19 in Applying UML and Patterns Book.
UML Diagrams By Daniel Damaris Novarianto S..
Chapter 16 UML Class Diagrams.
GRASP: Visibility and Design
Chapter 11: Collaboration Diagram - PART1
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
UML Diagrams Jung Woo.
The Object Oriented Approach to Design
UML Diagrams: The Static Model Class Diagrams
IMAT5205 Systems Analysis and Design
Chapter 20 Object-Oriented Analysis and Design
Understand and Use Object Oriented Methods
Chapter 11: Class Diagram
Chapter 16 UML Class Diagrams
Object Oriented System Design Class Diagrams
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Chapter 11: Class Diagram
Design Model: Creating Design Class Diagrams
Presentation transcript:

Chapter 16 Applying UML and Patterns Craig Larman 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 (DCDs) occurs within the design phase. The UML does not specifically define design class diagram. It is a design view of software entities, rather than an analytical view of domain concepts.

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 software classes that participate in the solution, plus the methods of classes. In practice, typically created in parallel w/ DCD Conceptual model Adds detail to the class definitions.

Example of a DCD

Information in a DCD A DCD illustrates the specifications for software classes and interfaces Typical information included: Classes, associations, and attributes Interfaces, with their operations and constants Methods Attribute type information Navigability Dependencies

Creating DCDs Identify all the classes participating in the software solution by analyzing 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 method parameters

Creating DCDs Continued 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

Add method name Method names come from interaction diagrams

After Methods Have Been Added

Issues Related to Method Names 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” issue The create message is the UML language independent form to indicate instantiation and initialization. Equivalent to calling the constructor method of a class 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 attribute values (accessor method - get) or set attribute values (mutator method) It is common idiom to have an accessor and mutator for each attribute, and to declare all attributes 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)

Consider the Audience for DCDs 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 software developers to read, exhaustive low-level detail may add too much noise

DCD – examples of classes

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

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

Associations with Navigability

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.

Dependency continued 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

Notation for method bodies in DCDs.

Interfaces The UML has several ways to show interface implementations. Most designers 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 << and >> ) 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»

Associations An association is a structural relationship that specifies that objects of one thing are connected to objects of another. Shown as a solid line

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. Shown as solid line with empty arrowhead

Aggregation / Composition Whole/part (Has-a) relationships More concerned with Compositions Part belongs to one composite at a time Part must always belong to a composite Composite creates/deletes its parts Aggregation: Composition:

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.

UP Artifacts