CS3773 Software Engineering Lecture 04 UML Class Diagram.

Slides:



Advertisements
Similar presentations
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall A.1.
Advertisements

Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Object-Oriented Analysis and Design
UML – Class Diagrams.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Slide 1 Chapter 7 Structural Modeling. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
Chapter 14 (Web): Object-Oriented Data Modeling
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 
© Copyright Eliyahu Brutman Programming Techniques Course.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
CS5103 Software Engineering
7M822 UML Class Diagrams advanced concepts 14 October 2010.
Chapter 14: Object-Oriented Data Modeling
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
The Unified Modeling Language (UML) Class Diagrams.
Object-Oriented Analysis and Design
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software.
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.
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
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.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
CHAPTER 13 (ONLINE): OBJECT-ORIENTED DATA MODELING © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13 (Online): Object-Oriented Data Modeling Modern Database Management 10 th Edition.
CHAPTER 13: OBJECT-ORIENTED DATA MODELING (OVERVIEW) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
Chapter 16 Applying UML and Patterns Craig Larman
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.
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 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.
What is a Structural Model?
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.
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.
Design Model Lecture p6 T120B pavasario sem.
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
 Week08.  Review Schedule Weeks 8-14  This week o Review last class o Introduce Class Diagrams o ICE-03 Sheridan SYST Engineering Quality Systems.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
Chapter 4 Extended Entity-Relationship (EER)Model Incorporates Set-subset Relationships Incorporates Generalization Hierarchies Constraints: Coverage Constraints:
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
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.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
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.
1 IS 0020 Program Design and Software Tools Unified Modeling Language Lecture 13 April 13, 2005.
1 IS 0020 Program Design and Software Tools Unified Modeling Language Lecture 13 November 30, 2004.
Data Modeling Using the Entity- Relationship (ER) Model
UML Diagrams: Class Diagrams The Static Analysis Model
Object-Oriented Modeling
Business System Development
Hao Zhong Shanghai Jiao Tong University
UML Class Diagrams: Basic Concepts
Object Oriented Analysis and Design
Software Engineering Lecture #11.
UML Class Diagram.
Chapter 20 Object-Oriented Analysis and Design
Understand and Use Object Oriented Methods
Presentation transcript:

CS3773 Software Engineering Lecture 04 UML Class Diagram

UTSA CS  Objects are discrete entities with well defined boundaries and encapsulate – States – Behaviors  Classes represent types of objects that share a set of features: attributes, operations, and relations  Classes describe key concepts involved in the problem domain  Classes are basic building blocks of OO system Class and Object

UTSA CS  Elements of class diagram: – Class represented as a box containing three compartments Name Attributes Operations – Relation represented as a line between two classes Association Generalization Aggregation and composition UML Class Diagram Syntax

UTSA CS  UML class diagrams can be used in three distinct ways depending on the phase of system development: – Conceptual (Domain Models) Requirements phase The diagram represents the problem that the software should solve Classes are real-world concepts in the system's environment Not necessarily a direct mapping to how these will be implemented (although they may end up being classes in the software system) Class Diagram: Perspectives

UTSA CS – Design The diagram is complete: both attributes and operations The diagram depicts only the interfaces of software classes, but still avoids implementation details (information hiding) – Implementation The diagram depicts interfaces and implementations of classes Class Diagram: Perspectives

UTSA CS Class  Classes are entities from the problem domain – Actors that interact with system – Any information that the system stores, analyzes, transforms, displays, etc. – Transient objects e.g., business transactions, phone conversations, etc.  Classes are named, usually, by short singular nouns  Syntax: A box with three compartments for names, attributes, and operations respectively

UTSA CS Class Diagram – An Example

UTSA CS Identifying Class  Classes are usually derived from the use cases for the scenarios currently under development  Brainstorm about all the entities that are relevant to the system  Noun Phrases – Go through the use cases and find all the noun phrases – Watch out for ambiguities and redundant concepts

UTSA CS Attribute  Attributes are simple data associated with a class e.g., integer, sets, dates  Attributes are properties of a class  Attributes are information that distinguishes one instance of the class from another instance  They are distinguishing characteristics of the objects  Syntax: name: type = default value

UTSA CS Operation  Operations are the responsibilities/services of an object in the class  Operations query or transform values of object's attributes, change state  A class's attributes and operations document the purpose of the class --- what information it maintains, and how that information can be manipulated  Syntax: name (parameters) : return-type

UTSA CS Static Attribute and Operation  Static attributes model data values shared by all objects of the class e.g., number of objects  Static operations are class-related operations not offered by instances of the class e.g., “create ()”, “search ()”  Syntax: underlined attribute or operation

UTSA CS Association  An association is a relationship between classes  An association is a name, usually short verb – Some people name every association – Others name associations only when such names will improve understanding e.g., avoid names like “is related to”, and “has”  An association represents different types of relationships e.g., data flow, requests, parts of compound class

UTSA CS Association Syntax  An association may have – An association name – Multiplicity – Role names – Qualifier – Association class – Navigability

UTSA CS Multiplicity  Multiplicities on associations give lower and upper bound on the number of instances of the local class that can be linked to one instance of the remote class  Syntax: 1, *, etc. at the association end. Examples: – * (zero or more) – 1.. * (one or more) – (one to 40) – 5 (exactly 5) – If no multiplicity is specified, the default is 1

UTSA CS Multiplicity  Multiplicities on classes indicate how many instances of the class can be at run time  Multiplicities constrain the number of objects  Syntax: 1, *, etc. at the top right corner of class

UTSA CS Role Name  Is a part of association  Describes how the object at the association end is viewed by the associated object  Is useful for specifying the context of the class  Syntax: name at the association end

UTSA CS Qualified Association  Qualified association is an association key that identifies the object at the other end of the association  Qualifier is a key or index used to identify one or fewer objects from set of many objects  Qualifier is often an attribute of the class at the other end of the association, and the attribute is recognized as uniquely identifying one or fewer objects of the class.  Syntax: name in box at the end of an association

UTSA CS Association Class  Association class allows to add attributes, operations to an association  The association contains more information  Syntax: class connected to the association by a dashed line  Constraint: only one instance of association class between any two associated objects

UTSA CS Generalization  Indicates an “is-a” relationship  All instances of the subclass are instances of the super class  A subclass inherits all attributes, operations and associations of the parent  The common attributes and operations are placed in the superclass; subclasses extend the attributes, operations, and associations as they need them  Syntax: open triangle at the superclass end of the association

UTSA CS Aggregation  Indicates a loose “has-a” relationship  The compound class is made up of its component classes  Represents the “whole-part” relationship, in which one object consists of the associated objects – The whole controls the relationship – The part services requests from the whole  Syntax: hollow diamond at the compound class end of the association

UTSA CS Aggregation Semantics  Whole can exist independently of the parts  Part can exist independently of the whole  Whole is incomplete if some of the parts are missing  It is possible to have shared ownership of the parts by several wholes

UTSA CS Composition  Composition is a particular kind of aggregation  Component classes are physically part of the compound class e.g., a car is composed of an engine, wheels, etc.  The component class dies if the compound class dies  Syntax: filled diamond at the compound class end of the association

UTSA CS Composition Semantics  Component belong to exactly one compound at a time  Compound is responsible for the creation and destruction of all its components  Compound may also release its components to other compounds  If the compound is destroyed, it must either destroy all its components, or give responsibility for them over to some other classes

UTSA CS Review of Class Diagram  Class is a set of discrete entities that share the same features  Class encapsulates data (attributes) and functions (operations: queries of modifiers)  Multiplicity constrains the number of objects participating in a relationship at any point in time  Relationship represents connections between classes – Association: role name, qualifier, association class, navigability – Generalization – Aggregation and composition

UTSA CS UML Object Diagram  Object is an instance of some class  Object diagram is a snapshot of the objects in a system  Object diagram represents all the instances of classes (objects) and their associations (links) at a point of time  Object diagram gives better feeling of problem by showing examples

UTSA CS UML Object Diagram Syntax  Object is a box with two compartments: object name and attributes  Objects name is underlined – Class name alone – Object name alone – Object name concatenated with the class name, separated by a colon – Name convention: starting with a lowercase letter  Relations among objects are represented as links

UTSA CS UML Object Diagram – An Example Ann: Patron Jo: Patron Tom: Patron A: Book : Book1 : Book2 : Book

UTSA CS Reading Assignments  UML 2 and The Unified Process – Chapter 7, “Objects and classes” – Chapter 8, “Finding analysis classes” – Chapter 9, “Relationships” – Chapter 18, “Refining analysis relationships”