Object-Oriented Analysis and Design

Slides:



Advertisements
Similar presentations
Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
Advertisements

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.
UML Class and Sequence Diagrams Violet Slides adapted from Marty Stepp, CSE 403, Winter 2012 CSE 403 Spring 2012 Anton Osobov.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Chapter 16. Fig Fig Note: If Sale references nothing then the only thing it is associated with is what references it Note: association name.
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 
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Lecture a: Additional UML Models: Package, Activity, Deployment Lecture b: Generalization, Aggregation and Additional Domain Model Notation Copyright W.
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.
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
The Unified Modeling Language (UML) Class Diagrams.
CSSE 374: Design Class Diagrams Steve Chenoweth Office: Moench Room F220 Phone: (812) These slides and others.
Objectives Design Class Diagrams Issues in system design Generalization Review UML papers.
UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 2: Modelling.
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
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.
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
What is MOF? The Meta Object Facility (MOF) specification provides a set of CORBA interfaces that can be used to define and manipulate a set of interoperable.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
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.
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,
Engineering 5895: Software Design 9/11/01Class Diagrams 1.
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.
© 2005 Prentice Hall9-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
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.
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
Object-Oriented Analysis and Design Feb 11, 2009.
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Object Oriented Analysis and Design Class and Object Diagrams.
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
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.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Object Modeling THETOPPERSWAY.COM. Object Modelling Technique(OMT)  Building a model of an application domain and then adding implementation.
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.
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)
Software Modelling Class Diagram. Class Diagrams The main building block in object oriented modeling They are used both for general conceptual modeling.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2006 Classes and Objects Patrick Bailey Keith Vander Linden Calvin College.
UML Diagrams: Class Diagrams The Static Analysis Model
UML Class Diagrams (more notation)
Design Class Diagrams
Chapter 16 UML Class Diagrams.
Design Class Diagrams
UML Diagrams: The Static Model Class Diagrams
Chapter 11: Class Diagram
Chapter 16 UML Class Diagrams
Object Oriented System Design Class Diagrams
Chapter 11: Class Diagram
Presentation transcript:

Object-Oriented Analysis and Design Chapters 16: UML Class Diagrams

What will we learn? UML Class Diagrams – What are they, how to create them

Introduction UML provides the tools for creating general class diagrams, i.e. static object modeling, that can be used to create Domain Models or software class diagrams We will look in more detail at the UML notation that can be used, irrespective of the perspective (conceptual or software class) Note that UML provides a set of diagraming tools, most of which are optional to use Standardized diagram language, makes it easier to communicate designs The next slide gives an overview of the concepts we will be discussing in this lecture

UML: Design Class Diagram (DCD)

Classifiers, Attributes A UML classifier is a model element that describes behavioral and structure features Think of classes or interfaces Attributes may also be called structural properties Attributes may be displayed in several ways in a UML diagram: Text in a class box On an association line Both of the above Full format for attribute text notation (note most items are optional): Visibility name : type multiplicity = default {property-string} Note that Visibility is the +- notation we saw earlier (+ public, - private)

UML: Notating Attributes

Attributes As Associations Notice that there are subtle differences between the conceptual perspective (Domain Model) and software perspective (Design Model) for attributes that are defined as associations For DCDs, there is usually A navigability arrow A multiplicity at the target end, but not the source A role name No association name

UML: Attributes as Associations

Attributes: Text versus Associations We explored the idea of data type objects earlier (Domain Models) Data types referred to objects for which individual identity is not important Recall a Person object versus a Name data type One guideline is to use the text for data types (basically primitive types) and associations for more complicated classes Note that this is a diagram preference – does not matter in the final code

UML: Attributes as Associations

Attributes: Lists How do we notate a list of attributes, e.g. an ArrayList in Java? “Note” Symbol

Operations and Methods Operations are usually displayed in the class box with the notation: visibility name (parameter-list) {property-string} Sometime a return-type is value is added Assume public if no visibility is shown An operation is a declaration (name, parameters, return type, exceptions list) A method is an implementation of an operation in sequence diagrams, may show the details and sequence of messages In class diagram, usually include some pseudo-code in a note with the <<method>> tag

Method Notation in UML Often times constructors (if included) are notated with the <<constructor>> tag Usually, getters and setters are ignored in class diagrams They are assumed to exist, or are added to the code on an as-needed basis

Keywords Keywords are textual adornments used to categorize a model element – they provide some additional information about the element. Usually notated <<keyword>>, and sometimes {keyword} Some examples: <<actor>> - this entity is an actor <<interface>> - this entity is an interface {abstract} – this is an abstract element, it can’t be instantiated {ordered} – this set of objects is ordered, e.g. the ArrayList example shown earlier

Abstract Classes As we saw earlier in Domain Models, UML has the ability to denote generalization Solid line with open, fat arrow; can also notate {abstract} in super-class It represents a relationship between more general classifier and more specific classifier. The specific classifier indirectly has the features of the more general classifier

Dependency in UML In UML, dependency lines can be used in any diagram, but they are especially common in class and package diagrams. In UML, a general dependency relationship indicates that a client element (class, package, use case, etc.) has knowledge of a supplier element and that a change in the supplier could affect the client Indicated by a dashed arrow from the client to the supplier Note that we often associate elements with associations (e.g. super- and sub-classes as we just saw), so we do not need to add dependency arrows if an association already exists Often used when a class has an attribute of another class type, or if one class sends a message to another class

Dependency in UML Guideline: Use dependency in UML to depict global parameter variable, local variable, and static- method call to another class. Public class Sale { Public void updatePrice(ProductDescription description) Money basePrice = description.getPrice(); …. }

Dependency in UML Public class Foo { Public void doX() system.runFinalization(); …. }

Dependency Labels

Interfaces may be notated in various ways in UML

Composition and Aggregation We saw this earlier in Domain Models … Composition is a whole-part relationship between model entities, such that an instance of the part belongs to only one instance of the composite a part must belong to a composite the composite is responsible for creating/deleting the parts. (So if the composite is destroyed, the parts are destroyed or become attached to another composite.) Aggregation is a weaker form of composition, where the above requirements are not necessarily true Aggregation does not imply ownership of the parts Composition involves instantiating objects, aggregation involves pointers to other objects

Composition: Example Generally look for “has a” associations

Constraints and Qualified Associations In UML diagrams, a constraint is a restriction on an element Usually indicated as some text between curly braces in the diagram, either in the class box or next to it Associations may be qualified – this means the association may depend upon a particular key or parameter. In the example on the next slide, we see a ProductCatalog that contains many ProductDescriptions. Each one is identified by an itemID. Note the change in multiplicity in the UML diagram; the association is now related to a single instance, but it is understood that the there may be many associations

Qualified Association

Association Classes In UML, an association may be considered a class, with attributes, operations, and other features Include this when the association itself has attributes associated with it

Takeaways from Chapter 16 Understand the basics of reading UML diagrams, in particular with how they represent class diagrams.

Next … Chapter 15 – Creating interaction diagrams in UML