UML Diagrams- Unified Modeling Language Introduction

ramakantsoni 3,666 views 40 slides Apr 26, 2015
Slide 1
Slide 1 of 40
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40

About This Presentation

Descriptive slides for Introduction to UML (Unified Modeling Design) diagrams.


Slide Content

Lecture 1: Introduction
Duration : 3 HRS
Object Oriented Modeling with UML
by
RamakantSoni
Assistant Professor
Dept. of Computer Science
B. K. Birla Institute of Engineering & Technology, Pilani
Ramakant Soni @ BKBIET Pilani 1

Objective of the module
Objective1:
Thiscourseistolearnmodelinganddesignprograms
usingtheobjectapproach.ThelanguageusedisUML.
Objective2:Objective2:
Toprovideasoftwaredevelopmentmethodology
startingtherealworlduntilthecompletionofthe
program
Objective3:
Learnhowtodesignobjectsinviewofreusability.
Ramakant Soni @ BKBIET Pilani 2

What is a Model?
Definition 1:
In (computers) Model is a simulation to reproduce
behavior of a system.
Definition 2:
Ramakant Soni @ BKBIET Pilani 3
Definition 2:
It’s the representation of entities and relationships
between them.
Definition 3:
A model serves as an abstraction -an approximate
representation of the real item that is being built.

What is modeling?
Definition1:Definition1:
Processofrepresentingareal-worldobjectorphenomenonas
asetofmathematicalequations.
Definition2:
Designingandanalyzingamathematicalrepresentationofan
economicsystemtostudytheeffectofchangestosystem
variables.
Ramakant Soni @ BKBIET Pilani 4

Why to model?
•Itisneithertechnicallywisenoreconomicallypracticalto
buildcertainkindofcomplexsystemswithoutfirstcreating
adesign,ablueprintoranotherabstractrepresentation.
Forexample:Professionalarchitectneedstofirstdevelop
anarrayofarchitecturalplansbeforeconstructingamulti-
officebuilding.officebuilding.
•Modelingprovidesarchitectsandotherswiththeabilityto
visualizeentiresystems,assessdifferentoptionsand
communicatedesignsmoreclearlybeforetakingonthe
risks-technical,financialorotherwiseofactual
construction.
Ramakant Soni @ BKBIET Pilani 5

When do we model?
Some specific situations in which the modeling effort is
worthwhile include:
•To better understand the business or engineering
situation at hand ("as-is" model) and to craft a better
system ("to-be" model).
situation at hand ("as-is" model) and to craft a better
system ("to-be" model).
•To build and design a system architecture.
•To create visualizations of code and other forms of
implementation.
Ramakant Soni @ BKBIET Pilani 6

How do We model?
•Astandardmeansforrepresentingsoftwaremodelsandrelated
artifacts.
Softwarearchitects,designersanddevelopersuseUMLforspecifying,
visualizing,constructinganddocumentingallaspectsofasoftware
system.
KeyleadersfromIBMRationalledtheoriginaldevelopmentofUML.
Today,UMLismanagedbytheObjectManagementGroup(OMG),which
ensurethatthespecificationcontinuestomeetthedynamicneedsofthe
softwarecommunity.softwarecommunity.
•UMLismorethanjustagraphicalnotationalstandard--itisamodeling
language.
Aswithalllanguages,UMLdefinessyntax(bothgraphicalandtextual)and
semantics(theunderlyingmeaningsofthesymbolsandtext).Havinga
truemodelinglanguageratherthanjustastandardnotationisessential
forstandardizingtheuseofUML.UML--atruemodelinglanguage--has
helpeditbecomethesoftwareindustry'smostrecognizedandwidely
applicablemodelingstandard.
Ramakant Soni @ BKBIET Pilani 7

Objects
•Objectsarekeytounderstandingobject-oriented
technology.
Ifwelookaroundrightnowandwe'llfindmany
examplesofreal-worldobjects:ourbook,desk,laptop,
orphones.
•Softwareobjectsareconceptuallysimilartoreal-world
objects:theytooconsistofstateandrelatedbehavior.
Anobjectstoresitsstateinfields/variablesand
exposesitsbehaviorthroughmethods/functions.
Ramakant Soni @ BKBIET Pilani 8

ObjectResponsibilities
Objects (classes) have responsibilities, which they
are expected to exhibit in an object-oriented
information:
•What they know about themselves -:(Attributes)•What they know about themselves -:(Attributes)
•What they do -: (Operations)
•What they know about other objects-:(Class and
object relationships)
Ramakant Soni @ BKBIET Pilani 9

Object Oriented Modeling
•Object-orientedmodelingisanapproachtomodeling
anapplicationthatisusedatthebeginningofthe
softwarelifecyclewhenusinganobject-oriented
approachtosoftwaredevelopment.
•Object-orientedmodelingistypicallydoneviause
casesandabstractdefinitionsofthemostimportant
objects.Themostcommonlanguageusedtodo
object-orientedmodelingistheObjectManagement
Group'sUnifiedModelingLanguage(UML).
Ramakant Soni @ BKBIET Pilani 10

Object Oriented Concept
Following are some fundamental concepts of object oriented world:
•Objects: Objects represent an entity and the basic building block.
•Class: Class is the blue print of an object.
•Abstraction: Abstraction represents the behavior of an real world entity.
•Encapsulation: Encapsulation is the mechanism of binding the data
together and hiding them from outside world.
•Inheritance: Inheritance is the mechanism of making new classes from
existing one.
•Polymorphism: It defines the mechanism to exists in different forms.
Ramakant Soni @ BKBIET Pilani 11

UML
•The key thing to remember about UML is that
it is designed to be universal, it is intended to
be independent of implementation platform.
Specifically it is a PIM, a platform-independent Specifically it is a PIM, a platform-independent
model.
Ramakant Soni @ BKBIET Pilani 12

Unified Modeling Language (UML)
•UMLisageneral-purposemodelinglanguageinthefieldof
softwareengineering,whichisdesignedtoprovideastandardway
tovisualizethedesignofasystem.
•ItwascreatedanddevelopedbyGradyBooch,IvarJacobsonand
JamesRumbaughatRationalSoftwareduring1994–95withfurther
developmentledbythemthrough1996.developmentledbythemthrough1996.
•In1997itwasadoptedasastandardbytheObjectManagement
Group(OMG),andhasbeenmanagedbythisorganizationever
since.In2000theUnifiedModelingLanguagewasalsoacceptedby
theInternationalOrganizationforStandardization(ISO)asan
approvedISOstandard.Sincethenithasbeenperiodicallyrevised
tocoverthelatestrevisionofUML.
Ramakant Soni @ BKBIET Pilani 13

4 parts to the UML 2.x specification:
•The Superstructure that defines the notation and
semantics for diagrams and their model elements.
•The Infrastructure that defines the core meta-model on
which the Superstructure is based.which the Superstructure is based.
•The Object Constraint Language (OCL) for defining rules
for model elements.
•The UML Diagram Interchange that defines how UML 2
diagram layouts are exchanged.
Ramakant Soni @ BKBIET Pilani 14

Design/Usage
Softwaredevelopmentmethods
UMLisnotadevelopmentmethodbyitself;however,itwas
designedtobecompatiblewiththeleadingobject-oriented
softwaredevelopmentmethodsofitstime.
UMLdiagramsrepresenttwodifferentviewsofasystemmodel:
•Static(orstructural)view:emphasizesthestaticstructureofthe
systemusingobjects,attributes,operationsandrelationships.
•Dynamic(orbehavioral)view:emphasizesthedynamicbehaviorof
thesystembyshowingcollaborationsamongobjectsandchanges
totheinternalstatesofobjects.
Ramakant Soni @ BKBIET Pilani 15

Applications of UML
•UMLisverypowerfulmodelinglanguage.Wecandevelopmanydiagrams
usingUMLandprovideuserswithready-to-use,expressivemodeling
examples.
•UMLcanbeappliedinmanyareaslikeembeddedsystems,web
applications,commercialapplicationsetc.
•SomeUMLtoolsgenerateprogramlanguagecodefromUML.
•UMLcanbeusedformodelingthewholesystemindependentofplatform
language.
•UMLgivesusastandardwaytowriteasystem'sview,coveringconceptual
thingssuchasbusinessprocessesandsystemfunctions,aswellasthings
likeclasseswritteninaspecificprogramminglanguage,database
schemas,andreusablesoftwarecomponents.
Ramakant Soni @ BKBIET Pilani 16

Areas where UML is effectively used
UML has been used effectively in following areas:
•Enterprise information systems.
•Banking and financial services.
•Telecommunications.
•Transportation.•Transportation.
•Defense.
•Retail.
•Medical electronics.
•Science and Research.
•Distributed Web-based services.
Ramakant Soni @ BKBIET Pilani 17

Why modeling with UML is used
•Modelingprovidesstructureforproblemsolving.
•Ifwemodelasystem,wemayfindmultiplesolutions.
•Modelinghelpsusmanagethecomplexityofsystemsbefore
actuallystartingdevelopmentwork.
•WithvariousdiagramsfromUMLwecanshowclearviewsof•WithvariousdiagramsfromUMLwecanshowclearviewsof
systemthusreducingtime-to-marketforbusinessproblem
solutions.
•Ifwemodelanyproblembeforeitsdevelopmentthereare
fewerchancesthatourdevelopmentplanwillgowrong,thus
decreasingdevelopmentcosts.
•Modelingreducestheriskofmistakes.
Ramakant Soni @ BKBIET Pilani 18

Designexamples:
Taxiservice-Workflowdiagram
"Ataxicab,alsoknownasataxioracab,isatypeofvehicleforhirewithadriver,usedbya
singlepassengerorsmallgroupofpassengersoftenforanon-sharedride.Ataxicabconveys
passengersbetweenlocationsoftheirchoice.Inmodesofpublictransport,thepick-upand
drop-offlocationsaredeterminedbytheserviceprovider,notbythepassenger,although
demandresponsivetransportandsharetaxisprovideahybridbus/taximode.Therearefour
distinctformsoftaxicab,whichcanbeidentifiedbyslightlydifferingtermsindifferent
countries:
(1)Hackneycarriagesalsoknownaspublichire,hailedorstreettaxis,licensedforhailing
throughoutcommunities.
(2)Privatehirevehicles,alsoknownasminicabsorprivatehiretaxis,licensedforpre-booking
only.
(3)Taxibuses,alsoknownasJitneys,operatingonpre-setroutestypifiedbymultiplestopsand
multipleindependentpassengers.
(4)Limousines,specializedvehiclelicensedforoperationbypre-booking.Althoughtypesof
vehiclesandmethodsofregulation,hiring,dispatching,andnegotiatingpaymentdiffer
significantlyfromcountrytocountry,manycommoncharacteristicsexist.“
Ramakant Soni @ BKBIET Pilani 19

Flow:
Ramakant Soni @ BKBIET Pilani 20

Is UML a Language?
•UMLcanbedescribedasageneralpurposevisual
modelinglanguagetovisualize,specify,construct
anddocumentsoftwaresystem.AlthoughUMLis
generallyusedtomodelsoftwaresystemsbutitis
notlimitedwithinthisboundary.Itisalsousedtonotlimitedwithinthisboundary.Itisalsousedto
modelnonsoftwaresystemsaswelllikeprocessflow
inamanufacturingunitetc.
•UMLisnotaprogramminglanguagebuttoolscan
beusedtogeneratecodeinvariouslanguages
usingUMLdiagrams.
Ramakant Soni @ BKBIET Pilani 21

Goal of UML
•Itsgoalistodefinesomegeneralpurpose
modelinglanguagewhichallmodelerscanuse
andalsoitneedstobemadesimpleto
understandanduse.
•UMLdiagramsarenotonlyfordevelopersbut
alsoforbusinessusers,commonpeopleand
anybodyinterestedtounderstandthesystem.
Thesystemcanbeasoftwareornon
software.
Ramakant Soni @ BKBIET Pilani 22

UML Diagrams
•UMLhasmanytypesofdiagramswhichare
dividedintotwocategories.Sometypes
representstructuralinformation,andtherest
representgeneraltypesofbehavior,includingrepresentgeneraltypesofbehavior,including
afewthatrepresentdifferentaspectsof
interactions.
Ramakant Soni @ BKBIET Pilani 23

UML Diagram Hierarchy
Ramakant Soni @ BKBIET Pilani 24

Ramakant Soni @ BKBIET Pilani 25

UML Building Blocks
The building blocks of UML can be defined as:
1.Things
2.Relationships
3.Diagrams3.Diagrams
Ramakant Soni @ BKBIET Pilani 26

UML Building Blocks
Thingscanbedefinedas:Structural,Behavioral,
Grouping&An-notational.
Relationshipshowshowelementsareassociated
witheachotherandthisassociationdescribesthewitheachotherandthisassociationdescribesthe
functionalityofanapplication.
UMLdiagrams:Alltheelements,relationshipsare
usedtomakeacompleteUMLdiagramandthe
diagramrepresentsasystem.
Ramakant Soni @ BKBIET Pilani 27

Structural things
TheStructuralthingsdefinethestaticpartofthemodel.Theyrepresent
physicalandconceptualelements.
Structuralthingsconstitutes:
•Class: Class represents set of objects having similar responsibilities.
Ramakant Soni @ BKBIET Pilani 28

Interface
Interfacedefinesasetofoperationswhichspecifythe
responsibilityofaclass.
Ramakant Soni @ BKBIET Pilani 29
I
Interface

Collaboration:
Collaboration defines interaction between elements.
Ramakant Soni @ BKBIET Pilani 30

Use case:
Use case represents a set of actions performed by a system for a specific goal.
Ramakant Soni @ BKBIET Pilani 31

Component
Component describes physical part of a system.
Ramakant Soni @ BKBIET Pilani 32

Node
A node can be defined as a physical element that exists at run time.
Ramakant Soni @ BKBIET Pilani 33

Behavioral things:
•A behavioral thing consists of the dynamic
parts of UML models.
Ramakant Soni @ BKBIET Pilani 34

Interaction:
•Interactionisdefinedasabehaviorthat
consistsofagroupofmessagesexchanged
amongelementstoaccomplishaspecifictask.
Ramakant Soni @ BKBIET Pilani 35
Message

State machine:
•Statemachineisusefulwhenthestateofanobject
initslifecycleisimportant.Itdefinesthesequence
ofstatesanobjectgoesthroughinresponseto
events.Eventsareexternalfactorsresponsiblefor
statechange.
Ramakant Soni @ BKBIET Pilani 36

Package:
•Package is the only one grouping thing available for gathering
structural and behavioral things.
Ramakant Soni @ BKBIET Pilani 37

Annotationalthings:
•Annotationalthings can be defined as a mechanism to
capture remarks, descriptions, and comments of UML model
elements. Note is the only one Annotationalthing available.
Ramakant Soni @ BKBIET Pilani 38
Notes

References :
•http://www.ibm.com/developerworks/rational/library/6007.h
tml
•http://en.wikipedia.org/wiki/Unified_Modeling_Language
•http://conferences.embarcadero.com/article/32200
•Tutorialspoint.com/ UML Tutorial•Tutorialspoint.com/ UML Tutorial
Ramakant Soni @ BKBIET Pilani 39

Thanks
Ramakant Soni @ BKBIET Pilani 40