Unified Modeling Language (UML)

Slides:



Advertisements
Similar presentations
UML an overview.
Advertisements

UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
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.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
UML Class Diagram and Packages
Unified Modeling Language (UML)
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Unified Modeling Language (UML)
CIT UPES | Sept 2013 | Unified Modeling Language - UML.
Unified Modeling Language, Version 2.0
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
1 UML Basic Training. UML Basic training2 Agenda  Definitions: requirements, design  Basics of Unified Modeling Language 1.4  SysML.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
بسم الله الرحمن الرحيم ” اللهم أنت ربي لا إله إلا أنت خلقتني و أنا عبدك وأنا على عهدك ووعدك ما استطعت ، أعوذ بك من شر ما صنعت ، أبوء لك بنعمتك على و أبوء.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
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.
An Introduction to the Unified Modeling Language
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 Software Design (UML) Class Name attributes operations A class is a description of a set of objects that share the same attributes,
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.
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
Software Engineering Lecture 8 Object-Oriented Analysis.
Class Diagram Chapter 21 Applying UML and Patterns Craig Larman.
1 Unified Modeling Language, Version 2.0 Chapter 2.
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.
Chapter 3: Introducing the UML
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.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
CS 501: Software Engineering Fall 1999 Lecture 15 Object-Oriented Design I.
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.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Modeling with UML – Class Diagrams
Object-Oriented Modeling
COMP 2710 Software Construction Class Diagrams
Object-Oriented Analysis and Design
Object-Oriented Modeling with UML
Systems Analysis and Design With UML 2
Introduction to Unified Modeling Language (UML)
Class diagram Description
University of Central Florida COP 3330 Object Oriented Programming
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
An Introduction to Inheritance
Software Architecture & Design Pattern
Introduction to Object Oriented Analysis, Design and Unified Modeling Language (UML) Shanika Karunasekera.
Inheritance B.Ramamurthy 11/7/2018 B.Ramamurthy.
Object Oriented Analysis and Design
Software Engineering Lecture #11.
2018, Fall Pusan National University Ki-Joune Li
UML Class Diagram.
Introduction to UML.
Unified Modelling Language
Software Engineering System Modeling Extra examples Dr.Doaa Sami
Understand and Use Object Oriented Methods
CIS 375 Bruce R. Maxim UM-Dearborn
Information System Design
2 UML for OOAD 2.1 What is UML? 2.2 Classes in UML
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Cheng (Sp2001): Object-Oriented Development Overview
From Class Diagram to Contract Diagram
2019, Fall Pusan National University Ki-Joune Li
Presentation transcript:

Unified Modeling Language (UML)

UML Graphic modeling language for describing object-oriented software. Started in 1994 Combined notations from 3 leading OO methods OMT, Object-modeling technique (James Rumbaugh) OOSE, Object-oriented software engineering (Ivar Jacobson) Booch method (Grady Booch)

Core UML Diagrams A diagram is the graphical presentation of a set of elements, most often rendered as a connected graph of things and relationships. Use case diagrams Describe functional behavior seen by (external) users Class diagrams Describe static structure of the classes in system

Use case diagrams Use Case Diagrams describe the functionality of a system and users of the system, i.e. what a new system should do or what an existing system already does. These diagrams contain the following elements: Actors, which represent users of a system, including human users and other systems. Use Cases, which represent functionality or services provided by a system to users. System boundary Association Actor (People) Actor (Systems) Use Case System

An use-cases example Library Supplier Borrow books Return books Interlibrary loan Circulation Clerk Do research Read books, newspaper Member Purchase supplies Supplier

Class diagrams The class diagram is the main building block in object oriented modeling. It represents the static structure of a system, describes how a system is structured rather than how a system behaves. contains the following elements: Classes, which represent entities with common characteristics or features. These features include attributes and operations. Associations, which represent relationships between classes.

Basic UML notation for classes Class name Class name attribute:primitiveDataType or Class attribute: type or Class=default value method ( ) method (argument_list):type or Class Attribute visibility - (private) # (protected) + (public) ~(package) Operations - (private) # (protected) + (public) Basic UML notation for classes

Basic UML notation for classes Example Basic UML notation for classes Class name Transcript +studentName: String +studentID: int +listOfCourseNames: List=null +lilstOfGrades:List=null +GPA: int +setStudentName(String name) +setStudentID(int ID) +addCourseName(String course) +addGrade(Char grade) +calculateAverage(): int +show() Attribute Operations

Parameterized classes type Stack +pop() : <type>

Basic Class Relationships Class A Class with parts Class with parts Class A Superclass Interface name Class B Assembly Class Assembly Class Class B Subclass Concrete Class Association Aggregation Composition Inheritance (Generalization) Dependency Realization

Associations A link between two classes Typically modeled as a member reference A Person works for a Company multiplicity Role names employee employer Person Company 0..* 1 works for Association Name Role names and multiplicity at association ends Direction arrow to aid reading of association name

Recursive Association Person Node Connects married to

Aggregation A special form of association that models a whole-part relationship between an aggregate (the whole) and its parts. Models a “is a part-part of” relationship. multiplicity 4 Car Wheel wheels Whole Part

Composition A strong form of aggregation The whole is the sole owner of its part The part object may belong to only one whole Multiplicity on the whole side must be one The life time of the part is dependent upon the whole The composite must manage the creation and destruction of its parts multiplicity Line Point 3..* 2 Polygon

Dependency A dependency indicates a semantic relation between two or more classes in which a change in one may force changes in the other although there is no explicit association between them A stereotype may be used to denote the type of the dependency Iterator Vector

Generalization Indicates that objects of the specialized class (subclass) are substitutable for objects of the generalized class (super-class) “is a” relationship Shape Super Class May be an abstract class Generalization relationship Sub Class Circle

Generalization conti. A sub-class inherits from its super-class Attributes Operations Relationships A sub-class may Add attributes and operations Add relationships Refine (override) inherited operations

<<interface>> List Realization A realization relationship indicates that one class implements a behavior specified by another class (an interface or abstract class). An interface can be realized by many classes. A class may realize many interfaces. LinkedList <<interface>> List LinkedList List

Basic Class Diagram (Example) Person Head Arm Class Student takes

Example: Class Diagram Student Transcript Course * Transcript studentName studentID listOfCourseNames lilstOfGrades average setStudentName() setStudentID() addCourseName() addGrade() calculateAverage() show() Student studentName studentID listOfCoursesID transcript:Transcript setStudentName() getStudentName() setStudentID() getStudentID() addToListofCourseIDs() makeTranscript() Course courseName courseID grade readCourseData() readCourseGrade() setCourseID()

UML Class Diagrams  Java Code Different representations of the same information Name, state, behavior of class Relationship(s) between classes Should be able to derive one from the other Motivation UML  Java Implement code based on design written in UML Java  UML Create UML to document design of existing code

Java  UML: Clock Example Java class Clock // name { // fields, members int seconds; int minutes; int hours; // methods void start(); void adjustTime(); void reset(); } Name Attributes Operations Class diagram Java code

Two basic relationships of Java classes class A { …. } class B { A x = new A(); … } Class B has-a class A. class A { …. } class B extends/implements A { … } Class B is-a class A. Relationships association, aggregation and dependency are has-a relationships. Generalization and realization are is-a relationships.

UML Packages A package is a general purpose grouping mechanism. Can be used to group any UML element (e.g. use case, actors, classes, components and other packages. Commonly used for specifying the logical distribution of classes. Name

Packages and Class Diagrams Add package information to class diagrams b a b.a a.A b.b.D b.b.E b.a.F b.a.G a.C a.B b.b

Homework A B C D E F In the following questions fill in is-a or has-a. Class D ______ class A. Class D ______ class E. Class E ______ class B. Class E ______ class C. Class F ______ class E.