Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.

Slides:



Advertisements
Similar presentations
ESE Einführung in Software Engineering 6. Modeling Objects and Classes Prof. O. Nierstrasz.
Advertisements

Object-oriented modeling Class/Object Diagrams
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
UML – Class Diagrams.
Chapter 16. Fig Fig Note: If Sale references nothing then the only thing it is associated with is what references it Note: association name.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
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 
Class Diagram & Object Diagram
7M822 UML Class Diagrams advanced concepts 15 September 2008.
7M822 UML Class Diagrams advanced concepts 14 October 2010.
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
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
Object-Oriented Analysis and Design Feb 25, 2009.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
Design Class Diagrams (DCDs)
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,
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.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Lecture 1: UML Class Diagram September 12, UML Class Diagrams2 What is a Class Diagram? A class diagram describes the types of objects in the system.
Object-Oriented Analysis and Design Feb 11, 2009.
Design Jon Walker. More UML ● What is UML again?
Class Diagram. Classes Software Design (UML) Class Name attributes operations A class is a description of a set of objects that share the same attributes,
Class Diagram Classes are the most important building block of any object-oriented system. A class is a description of a set of objects that share the.
Logical view –show classes and objects Process view –models the executables Implementation view –Files, configuration and versions Deployment view –Physical.
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Chapter 10 Defining Classes. The Internal Structure of Classes and Objects Object – collection of data and operations, in which the data can be accessed.
Design Model Lecture p6 T120B pavasario sem.
Relationships Relationships between objects and between classes.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
1 Class Diagrams. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are for visualizing, specifying and documenting.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Chapter 16: UML Class Diagrams
INFO 620Lecture #71 Information Systems Analysis and Design Design Class Diagrams and others INFO 620 Glenn Booker.
Chapter 16 UML Class Diagrams.
Chapter 3: Introducing the UML
Identifying classes, Packages and drawing class Diagrams, Object Diagrams and composite structure diagrams Week 07 1.
Object Modeling THETOPPERSWAY.COM. Object Modelling Technique(OMT)  Building a model of an application domain and then adding implementation.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
Chapter 7 Classes and Methods III: Static Methods and Variables Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition)
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
Class Diagram Lecture # 1. Class diagram A Class Diagram is a diagram describing the structure of a system shows the system's classes Attributes operations.
TK2023 Object-Oriented Software Engineering CHAPTER 11 CLASS DIAGRAMS.
Kyung Hee University Class Diagramming Notation OOSD 담당조교 석사과정 이정환.
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)
Modeling with UML – Class Diagrams
UML Diagrams By Daniel Damaris Novarianto S..
UML Class Diagrams (more notation)
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Design Class Diagrams
Chapter 16 UML Class Diagrams.
Design Class Diagrams
UML Diagrams Jung Woo.
Object Oriented Analysis and Design
UML Class Diagram.
Understand and Use Object Oriented Methods
Chapter 16 Class Diagrams.
Chapter 16 UML Class Diagrams
Object Oriented System Design Class Diagrams
Presentation transcript:

Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole

What They Are They illustrate classes, interfaces, and their associations. They are used for static object modeling. 2CS6359 Fall 2012 John Cole

3

Design Class Diagram A class diagram can be used to visualize a domain model. We also need a unique term to clarify when the class diagram is used in a software or design perspective. A common modeling term for this purpose is design class diagram (DCD) 4CS6359 Fall 2012 John Cole

Design Class Diagram CS6359 Fall 2012 John Cole5

Classifier A UML classifier is “a model element that describes behavioral and structure features”. Classifiers can also be specialized. They are a generalization of many of the elements of the UML, including classes, interfaces, use cases, and actors. In class diagrams, the two most common classifiers are regular classes and interfaces. CS6359 Fall 2012 John Cole6

Showing UML Attributes Attribute text notation such as: currentSale : Sale, Association line notation, or both name : type multiplicity = default {property string} Attributes are assumed private if no visibility is given Arrow shows that the object where the arrow starts has one object of the object to which it points. CS6359 Fall 2012 John Cole7

UML Attributes CS6359 Fall 2012 John Cole8

UML Attributes Multiplicity shows how many on the left can associate with how many on the right Role name Attributes are assumed private unless otherwise noted CS6359 Fall 2012 John Cole9

Attribute Text vs. Association Lines Use text notation for primitive data types, even things like Zip codes that may have components but are not complex Use association for everything else. CS6359 Fall 2012 John Cole10

Collection Attributes CS6359 Fall 2012 John Cole11

Note Symbols A UML note symbol is displayed as a dog-eared rectangle with a dashed line to the annotated element; they’ve already been used throughout the book. A note symbol may represent several things, such as: – a UML note or comment, which by definition have no semantic impact – a UML constraint, in which case it must be encased in braces ‘{…}’ – a method body—the implementation of a UML operation CS6359 Fall 2012 John Cole12

Operations and Methods A method is the implementation of an operation CS6359 Fall 2012 John Cole13

The Create operation This is a constructor call You can use > to make this explicit CS6359 Fall 2012 John Cole14

Keywords A UML keyword is a textual adornment to categorize a model element Keywords include >, >, [abstract], [ordered] CS6359 Fall 2012 John Cole15

Stereotypes, Profiles, Tags Stereotypes are also shown in guillemets symbols. They are not keywords. A stereotype represents a refinement to an existing modeling concept CS6359 Fall 2012 John Cole16

Properties and Property Strings A property is “a named value denoting a characteristic of an element Textual approach is to use the UML property string {name1=value1, name2=value2} format, such as {abstract, visibility=public} CS6359 Fall 2012 John Cole17

Generalization A taxonomic relationship between a more general classifier and a more specific classifier This can imply inheritance, but not at the conceptual level. CS6359 Fall 2012 John Cole18

Dependency Similar to association. Indicates that a client element has knowledge of another supplier element, and a change in the supplier could affect the client (Supplier and client are descriptive terms, not classes) Dependency lines are common on class and package diagrams Use to depict global, parameter variable, local variable, and static-method dependency CS6359 Fall 2012 John Cole19

Types of Dependency Having an attribute of supplier type Send a message to a supplier Receiving a parameter of supplier type Supplier is a superclass or interface Indicated by a dashed line arrow CS6359 Fall 2012 John Cole20

Interfaces CS6359 Fall 2012 John Cole21

Composition Vs. Aggregation Aggregation is a vague association suggesting whole-part relationships. No meaningful semantics in UML versus association. Composition, or composite aggregation, is a strong kind of whole-part relationship. Implies that an instance of the part belongs to only one composite instance of the whole CS6359 Fall 2012 John Cole22

Composition For example the Monopoly board consists of 40 squares A square can be part of only one board at any time. CS6359 Fall 2012 John Cole23

Constraints Constraints is a restriction on a UML element. Shown as text between braces {size > 0} CS6359 Fall 2012 John Cole24

Qualified Association Uses a qualifier to select an object or set of objects from a larger set For example, looking up something in a HashMap CS6359 Fall 2012 John Cole25

Association Class Allows you to treat an association as a class, such that it can have attributes CS6359 Fall 2012 John Cole26

Singleton Class Only one instance of a Singleton class (pattern explained later) is ever instantiated. For example, your main class in most programs is a Singleton, although this may not be its dominant pattern. CS6359 Fall 2012 John Cole27

Template Classes and Interfaces These are equivalent to C++ or Java “generics.” That is, you can type a collection class. CS6359 Fall 2012 John Cole28

User-Defined Compartments In a class diagram you can define your own compartments: CS6359 Fall 2012 John Cole29 DataAccessObject Id: int doX(); Exceptions thrown DatabaseException IOExeception Responsibilities Serialize and write objects Read and deserialize objects

Active Class An active object runs on and controls its own thread of execution In UML, it is shown with double vertical lines on the left and right of the class box. CS6359 Fall 2012 John Cole30