Modeling with UML – Class Diagrams

Slides:



Advertisements
Similar presentations
UML an overview.
Advertisements

A Brief Introduction. Acknowledgements  The material in this tutorial is based in part on: Concurrency: State Models & Java Programming, by Jeff Magee.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 System modeling 2.
CS 340 UML Class Diagrams. A model is an abstraction of a system, specifying the modeled system from a certain viewpoint and at a certain level of abstraction.
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
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.
Kari R. Schougaard, PhD Stud. Værktøjer og Teknikker, 2006 UNIVERSITY OF AARHUS Department of Computer Science Unified Modeling Language Visual language.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
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.
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.
CIT UPES | Sept 2013 | Unified Modeling Language - UML.
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.
1 UML Basic Training. UML Basic training2 Agenda  Definitions: requirements, design  Basics of Unified Modeling Language 1.4  SysML.
Slide 1 Structural Modeling Chapter 7. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
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.
Copyright © 2013 Curt Hill UML Unified Modeling Language.
Lecture 6: Structural Modeling
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in.
Unified Modeling Language. Object Oriented Methods ► What are object-oriented (OO) methods?  OO methods provide a set of techniques for analyzing, decomposing,
Relationships Relationships between objects and between classes.
CSE 403, Spring 2008, Alverson Using UML to express Software Architecture.
CSE 403, Spring 2007, Alverson Using UML to express Software Architecture.
The Unified Modeling Language (UML)
Class Diagram Chapter 21 Applying UML and Patterns Craig Larman.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
Chapter 5 System Modeling. What is System modeling? System modeling is the process of developing abstract models of a system, with each model presenting.
CSCI 3428: Software Engineering Tami Meredith UML Unified Modeling Language.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
Class Diagrams. Terms and Concepts A class diagram is a diagram that shows a set of classes, interfaces, and collaborations and their relationships.
1 SWE Introduction to Software Engineering Lecture 14 – System Modeling.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
CS 501: Software Engineering Fall 1999 Lecture 15 Object-Oriented Design I.
Basic Characteristics of Object-Oriented Systems
UML. Model An abstract representation of a system. Types of model 1.Use case model 2.Domain model 3.Analysis object model 4.Implementation model 5.Test.
11 Systems Analysis and Design in a Changing World, Fifth Edition.
Data Modeling Using the Entity- Relationship (ER) Model
Embedded Systems Software Engineering
UNIT-IV Designing Classes – Access Layer ‐ Object Storage ‐ Object Interoperability.
Embedded Systems Software Engineering
Unified Modeling Language (UML)
Passing from design to implementation
Evolution of UML.
Chapter 5: Structural Modeling
Inheritance Allows extension and reuse of existing code
Object-Oriented Analysis and Design
Systems Analysis and Design With UML 2
Unified Modeling Language
Introduction to Unified Modeling Language (UML)
Introduction to Unified Modeling Language (UML)
Review: Two Programming Paradigms
University of Central Florida COP 3330 Object Oriented Programming
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
UML Unified Modelling Language
Object Oriented Analysis and Design
UML Class Diagram.
Introduction to UML.
Chapter 20 Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Unified Modelling Language
Understand and Use Object Oriented Methods
Analysis models and design models
Copyright 2007 Oxford Consulting, Ltd
Class Diagrams Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application.
Chapter 22 Object-Oriented Systems Analysis and Design and UML
CIS 375 Bruce R. Maxim UM-Dearborn
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Presentation transcript:

Modeling with UML – Class Diagrams Jarosław Kuchta Embedded Systems Software Engineering Modeling with UML – Class Diagrams GUT - INTEL 2015/16 Embedded Systems Software Engineering

Embedded Systems Software Engineering Goals of Modeling To help developers to understand problem domain structure, rules, constraints To unveil missing requirements To control how development follows reality (to deal with complexity) GUT - INTEL 2015/16 Embedded Systems Software Engineering

Modeling vs. Development Modeling = Analysis & Design Development = Design & Implementation Implementation = Coding & Debugging UML – Unified Modeling Language (graphical language) UML was provided for modeling UML is also used for design UML does not have enough detail level for implementation GUT - INTEL 2015/16 Embedded Systems Software Engineering

Models vs. Diagrams Model – abstract representation of a system Abstraction – refinement stop problem Diagram – graphical representation of a model UML uses diagrams to model a software system There are other model representations known (e.g. CRC – Class- Responsibility-Collaboration Cards) UML tools usually have two layers of information: graphical layer (layout) semantic layer (project elements) Diagrams are often not sufficient to represent all the model details Not only diagrams, but semantic elements specification are needed Diagrams provide large scale view of the project GUT - INTEL 2015/16 Embedded Systems Software Engineering

Embedded Systems Software Engineering UML Diagrams Static structure diagrams class diagram component diagram deployment diagram Functionality diagrams use case diagram interaction diagram sequence diagram collaboration diagram Behavioral diagrams state transition diagram activity diagram Missing in UML (available by profiles) timing diagrams entity-relationship diagrams navigation diagrams ... GUT - INTEL 2015/16 Embedded Systems Software Engineering

Class diagram elements class definition frame header class name attributes operations compartments generalization-specialization - private attribute # protected attribute + public attribute weak aggregation strong aggregation 0..1 1..* association (binary) GUT - INTEL 2015/16 Embedded Systems Software Engineering

Class diagram usage (differences modeling <-> development) Developers treat classes as software structures (data + functions) Analysts treat classes as abstraction of real world entities One model class  many software classes Modeling classes: no need for many classes, no need for many class attributes, no need for class functions GUT - INTEL 2015/16 Embedded Systems Software Engineering

Other (subtle) differences (1) Entity – something that exists in the real world, has a large set of features Object – some entity that exists in the model, has limited set of features Class – a potential object or set of objects (also empty if class is abstract) Class – object structure definition Property – an informative feature of a class Attribute – data unit held by object Relationship – a logical binding between two or more classes Link – a logical binding between two or more objects; an instantiation of a relationship Generalization-specialization – an ontology relationship between two classes (“is a” relationship) Inheritance – a mechanism for passing features from a generalized to a specialized class Multiple inheritance – when a class has multiple generalizations (often modeled) Single inheritance – when a class has only one (direct) generalization (often required by implementation language) GUT - INTEL 2015/16 Embedded Systems Software Engineering

Other (subtle) differences (2) Aggregation (strong aggregation) – a relationship between classes that allows joining two or more objects (components) together; a new object (an assembly) is created Containment (weak aggregation) – a relationship between classes that allows including one or more objects in other object (a container) Association – any other logical relationship between two or more classes, enables joining many objects Pointer, reference – a specific implementation of an association; only two objects are unidirectionally linked, bidirectional association requires two pointers / references, binary n-to-n associations and n-ary associations require complex implementation Association role – a name of an object when it is linked to other object, class name can be used as a role substitute but only when classes at opposite sides of the association are different Pointer/reference name – represents a role of an object in an association Association name – a semantic name of the relationship represented by an association Relationship name – implemented in a database data structure as an index name Association direction – a direction in which an association should be read Navigation direction – determines which object has a pointer/reference that enables access to the object as the other side of the association GUT - INTEL 2015/16 Embedded Systems Software Engineering

Other (subtle) differences (3) Multiple property – a property with many values Multiple association side – a side of an association which allows many objects at this side Collection, list – a container of objects Array – a specific implementation of a collection Multiplicity – a potential (minimal and maximal) count of values in one property or associated objects at one side of an association Collection (list) length - an actual count of objects in a container Collection (list) capacity - maximal count of objects in a container Array size – a concrete count of objects in an array Operation – an abstract action that can be performed by an object or with an object of the class Function – a concrete definition of an operation; needs a result type declaration and parameters specification; can be overloaded and redefined Method – a concrete implementation of some function, can be virtual, abstract and overridden Class name – a name of a class when it is used in a model; it can consist of two or more words and national letters Class identifier – a name of a class when it is implemented in a program; only one word is allowed (eventually words joined with underscores), national letters in some languages GUT - INTEL 2015/16 Embedded Systems Software Engineering

Other (subtle) differences (4) ID property – not needed in analysis – needed in database design Visibility (private, protected, public) – not needed in analysis; all features are public - can be used in design, in implementation also used internal visibility (in the assembly) -attribute name – private attribute #attribute name – protected attribute +attribute name – public attribute GUT - INTEL 2015/16 Embedded Systems Software Engineering

Embedded Systems Software Engineering Derived attribute /age= current year – year(birth date) +/age GUT - INTEL 2015/16 Embedded Systems Software Engineering

Embedded Systems Software Engineering N-ary attributes name [multiplicity] n – exactly n values 0..1 – no values or one value 0..n – no values and no more than n values n..m – no less than n and no more than m values 0..* – no values or possibly many values n..* – no less than n values * – possibly many values GUT - INTEL 2015/16 Embedded Systems Software Engineering

Embedded Systems Software Engineering Attribute types General types – used in analysis number integer real Specific types – used in design decimal longint double Defined types (enums) GUT - INTEL 2015/16 Embedded Systems Software Engineering

Embedded Systems Software Engineering Example Controller +Language: String +Code: String Device controller +Device Name: String Process controller +Process ID: Number GUT - INTEL 2015/16 Embedded Systems Software Engineering

Operation stereotypes <<constructor>> – creates a new instance <<destructor>> – destroys an instance <<query>> – gets a state of an object (state remains unchanged) <<update>> – changes a state of an object A state of an object – one or more object attributes GUT - INTEL 2015/16 Embedded Systems Software Engineering

Embedded Systems Software Engineering Aggregation Measurement +Number: String +Date: Date Time +Person ID: Number Measurement result +Controller: Controller +Value: Real GUT - INTEL 2015/16 Embedded Systems Software Engineering

Embedded Systems Software Engineering Association multiplicity Measurement +Number: String +Date: Date Time +Person ID: Number Employee 0..* 1 3performs association name association direction GUT - INTEL 2015/16 Embedded Systems Software Engineering

Embedded Systems Software Engineering N-ary association Measurement +Number: String +Date: Date Time +Person ID: Number Employee Supervisor GUT - INTEL 2015/16 Embedded Systems Software Engineering

Embedded Systems Software Engineering Association roles Employee Employee subordinate superordinate 1 0..* GUT - INTEL 2015/16 Embedded Systems Software Engineering

Embedded Systems Software Engineering Association class Employee Department Delegation +Date GUT - INTEL 2015/16 Embedded Systems Software Engineering

Embedded Systems Software Engineering Class model purpose Static analysis of a problem domain Basis for functional and behavioral analysis Application logic design Helper for implementation Note: various levels of abstraction-refinement GUT - INTEL 2015/16 Embedded Systems Software Engineering

Embedded Systems Software Engineering Bibliography Grady Booch, James Rumbaugh, Ivar Jacobson: Unified Modeling User Guide (book, PDF) GUT - INTEL 2015/16 Embedded Systems Software Engineering