Top Banner
UML Unified Modelling Language Dr. Santosh Kumar Swain Associate Professor School Of Computer Engineering KIIT , Bhubaneswar. Mob-9437162867 06/06/2022 1 KIIT SCHOOL of COMPUTER ENGINEERING
85
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 1

UML Unified Modelling

Language

Dr. Santosh Kumar SwainAssociate Professor

School Of Computer EngineeringKIIT , Bhubaneswar.Mob-9437162867

Page 2: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 2

Model

• A model is an abstract representation of a system (process or structure) prior to building or modifying it.

• A model is simplification of reality.• Modeling techniques used for analysis and

design involve graphic languages (sets of symbols).

• Modeling is used frequently during many phases of software development frequently.

Page 3: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 3

Modeling LanguageA modeling language must include

Model elements– fundamental modelling concepts and semantics.

Notation – Visual rendering of model elements.Guidelines – expression of usage within the trade.

Benefits of visual notation are• Clarity• Familiarity• Maintenance• Simplification

Page 4: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 4

Advantages of Modeling

Turban cites Easier to express complex ideas. Reduction of complexity. Enhance and reinforce learning and training. Manipulation is easier

Key ideas regarding modeling are• Rarely correct in first try.• Always seek advice and criticism for others.• Avoid excess model revisions.

Page 5: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 5

Model Representation

• Static Model – viewed as a snapshot of a system’s parameter at rest at a specific point in time.

Represent the structural or static aspect of a system.

• Dynamic Model – viewed as a collection of procedures or behaviors

Reflect the behavior of a system over time.Show how the business objects interact to

perform tasks.

Page 6: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 6

What is UML?

UML – Unified Modeling Language is a• Standard language for specifying, visualizing,

constructing and documenting the artifacts of software intensive systems.

• Collection of best engineering practices that have proven successful in modeling large and complex systems.

Page 7: Uml

7

UML Diagram – What is UML?

The Unified Modeling Language (UML) is a standard language for

Specifying Visualizing Constructing Documenting

the artifacts of software intensive system.

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING

Page 8: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 8

Goals of UML

• Provide users with a ready-to-use, expressive visual modeling language so they can develop and exchange meaningful models.

• Provide extensibility and specialization mechanisms to extend the core concepts.

• Be independent of particular programming languages and development processes.

• Provide a formal basis for understanding the modeling language.• Encourage the growth of the OO tools market.• Support higher-level development concepts such as

collaborations, frameworks, patterns and components.• Integrate best practices.

Page 9: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 9

Why use UML?

• Helps to reduce cost and time-to-market.• Helps managing a complex project architecture.• Helps to convey ideas between developers \

designers \ etc.

Page 10: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 10

Background• 1996 – Release of UML 0.9 by by Grady Booch,

Jim Rumbaugh of Rational Software Corporation, Ivar Jacobson of Objectory company.

• 1996 – Release of UML 1.0 by Digital Equipment, HP, Ilogix, IntelliCorp, IBM, ICON, MCI, Microsoft, Oracle, Rational, TI and Unisys.

• 1997 – Release of UML 1.1 by IBM, ObjecTime, Platinum, Ptech, Taskon, Reich and Softeam

• 2001 – Work on UML 2.0 specifications.

Page 11: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 11

Based Principally on:

OMT [Rumbaugh 1991] Booch’s methodology[Booch 1991] OOSE [Jacobson 1992] Odell’s methodology[Odell 1992] Shlaer and Mellor [Shlaer 1992]

UML Lineology

Page 12: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 12

Different Object Modeling Techniques in UML

UML Booch’sMethodologyOOSE

OMT

Page 13: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 13

Adopted by Object Management Group (OMG) in 1997.

OMG is an association of industriesPromotes consensus notations and

techniquesUsed outside software development

Example car manufacturing

UML as A Standard

Page 14: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 14

Developments to UML

• UML continues to develop:– Refinements

– Making it applicable to new contexts

UML 1.X

UML 1.0

UML 2.0

Application to embedded systems

Page 15: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 15

UML is a modelling language. Not a system design or development

methodology

Used to document object-oriented analysis and design results.

Independent of any specific design methodology.

Object Modelling Using UML

Page 16: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 16

Modeling a House

Page 17: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 17

Views of a system: User’s view Structural view Behavioural view Implementation view Environmental view

UML Model Views

Page 18: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 18

UML Diagrams

User’s View- Use Case

Diagram

Structural View- Class Diagram- Object Diagram

Implementation View- Component Diagram

Environmental View- Deployment Diagram

Behavioural View- Sequence Diagram- Collaboration Diagram - State-chart Diagram - Activity Diagram

Diagrams and views in UML

Page 19: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 19

Basic Building Blocks of The UML

There are four kinds of things in the UML.

1. Structural Things.

2. Behavioral Things.

3. Grouping Things.

4. Annotational Things.

Page 20: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 20

Structural Things Annotational ThingsGrouping ThingsBehavioral Things

1. Class

2. Interface

3. Collaboration

4. Use Case

5. Active Class

6. Components

7. Nodes

2. State Mechanism

1. Interaction 1. Packages 1. Notes

Things in UML

Page 21: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 21

A Diagram is the graphical presentation of a set of elements, most often rendered as a connected graph of things and relationships. Every complex system is best approached through a mall et of nearly independent views of a model; no single view is sufficient. Every model may be expressed at different levels of fidelity. UML includes 9 such diagrams.

1 Use Case DiagramStatic(structural) 2 Class Diagram. 3 Object Diagram. 4 Implementation Diagram

4.1 Component Diagram 4.2 Deployment DiagramDynamic(Behavioral) 5 Interaction Diagram

5.1 Sequence Diagram5.2 Collaboration Diagram.

6 State Chart Diagram. 7 Activity Diagram.

Diagrams in UML

Page 22: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 22

Relationships

UML have 4 kinds of relationships:• Association – Two classes are associated if one class has to know

about the other.oAggregation – An association in which one class belongs to a

collection in the other. When something contains collection of things that are not part of it.

o Composition when something is part of something else. • Generalization – An inheritance link indicating one class is a base

class of the other.• Dependency – A labeled dependency between classes (such as

friend classes, instantiation)• Realization --Found between:

– Interfaces and the classifiers that realize them

Page 23: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 23

Aggregation

Page 24: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 24

Use Case Diagrams

• Describes what a system does from the standpoint of an external observer.

• Emphasis on what a system does rather then how.• Provides system requirements from the user’s point of

view.• Scenario – an example of what happens when someone

interacts with the system.• Actor – A user or another system that interacts with the

modeled system.• A use case diagram describes the relationships between

actors and scenarios.

Page 25: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 25

Use Case Associations

UML defines 3 kinds of associations:• Communication – defines a relationship

between an actor and a use case.• Extend - defines that instances of a use case

may be augmented with some additional behavior defined in an extending use case.

• Uses - defines that a use case uses a behavior defined in another use case.

Page 26: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 26

Use Case Relation

• <<include>> used when one use case will invoke another use case.

• <<extends>>used when one use case may invoke another use case.

Page 27: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 27

Representation of Use Cases

• Represented by use case diagram• A use case is represented by an ellipse• System boundary is represented by a rectangle• Users are represented by stick person icons

(actor)• Communication relationship between actor and

use case by a line• External system by a stereotype

Page 28: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 28

Use Case Diagram NotationActor

Association

Use Case

Use case with Extension points

<<Uses>>

<<Extends>>

Page 29: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 29

Use case diagram

Online C2C shopping

• overview the usage requirements• presentations project stakeholders• "the meat" of the actual requirements

Actor

Actor:

An actor is a person, organization, or external system that plays a role in one or more interactions with your system

Use caseUse case: A use case describes a sequence of actions that provide something of measurable value to an actor and is drawn as a horizontal ellipse

System boundary

System boundary: indicates the scope of your system. Anything within the box represents functionality that is in scope and anything outside the box is not

Page 30: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 30

Use Case Example

Page 31: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 31

Use Case Model • Consists of set of “use cases”• An important analysis and design artifact• The central model:

–Other models must confirm to this model–Not really an object-oriented model–Represents a functional or process model

Page 32: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 32

Use Cases • Different ways in which a system can be used by

the users• Corresponds to the high-level requirements• Represents transaction between the user and

the system• Defines external behaviour without revealing

internal structure of system• Set of related scenarios tied together by a

common goal.

Page 33: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 33

Use Cases Cont…

• Normally, use cases are independent of each other

• Implicit dependencies may exist• Example: In Library Automation System,

renew-book and reserve-book are independent use cases.– But in actual implementation of renew-book--- A

check is made to see if any book has been reserved using reserve-book.

Page 34: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 34

Example Use Cases

–Library information system•issue-book•query-book•return-book•create-member•add-book, etc.

Page 35: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 35

Factoring Use Cases• Two main reasons for factoring:

–Complex use cases need to be factored into simpler use cases

–To represent common behavior across different use cases

• Three ways of factoring:–Association/Generalization–Includes–Extends

Page 36: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 36

Factoring Use Cases UsingGeneralization

Pay membership fee

Pay through library pay cardPay through credit card

Page 37: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 37

Factoring Use Cases Using Includes

Base use caseCommon use case

<<include>>

Base use case 2

Common use caseCommon use caseCommon use case

Base use case 1

<<include>>

<<include>>

<<include>>

<<include>>

Page 38: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 38

Example of Factoring Use Cases Using Includes

Issue Book

Check Reservation

Renew Book

<<include>><<include>>

Page 39: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 39

Factoring Use Cases UsingExtends

Base use case

Common use case

<<extends>>

Page 40: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 40

Factoring Use Cases UsingExtends

OrderItem

Show Catalog

<<extends>>

Page 41: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 41

Class DiagramsClass Diagrams describe the static structure of a system,

or how it is structured rather than how it behaves.

Class diagrams are static – display what interacts but not what happens when interaction occurs.

These diagrams contain the following elements.• Classes, which represent entities with common characteristics

or features. These features include attributes, operations and associations.

• Associations, which represent relationships that relate two or more other classes where the relationships have common characteristics or features. These attributes and operations.

Page 42: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 42

Class Diagram

• Classes are represented by a rectangle divided to three parts: class name, attributes and operations.

• Attributes are written as:visibility name [multiplicity] : type-expression = initial-value• Operations are written as:visibility name (parameter-list) : return type-expression• Visibility is written as:+ public# protected- private

Page 43: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 43

Class Diagram

Page 44: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 44

Class Diagram

• Main constituents are classes and their relationships:–Association–Aggregation–Generalization–Dependencies

Connected as a graph to each other and to their contents

Page 45: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 45

Class Diagram

Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and attributes of the classes.

Name

Attributes

Operations

Relations

• Associations• Aggregation• Generalization

Page 46: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 46

Class Diagram Example

Page 47: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 47

Object Diagram

• Shows snapshot of detailed state of the system at a point of time.

• Notation is same a class diagram.• Class diagrams can contain objectsSo a class diagram with objects and no classes is

an object diagram.

Page 48: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 48

Object Diagram

Object Diagrams describe the static structure of a system at a particular time.

A class model describes all possible situations, whereas an object model describes a particular situation.

Object diagrams contain the following elements:• Objects, which represent particular entities. These are

instances of classes.• Links, which represent particular relationships

between objects. These are instances of associations.

Page 49: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 49

Object Diagram

Different representations of the LibraryMember object

LibraryMember

MritunjayB10028C-108, Laksmikant Hall1119Mrituj@cse25-02-0425-03-06NIL

IssueBook( );findPendingBooks( );findOverdueBooks( );returnBook( );findMembershipDetails( );

LibraryMember

MritunjayB10028C-108, Laksmikant Hall1119Mrituj@cse25-02-0425-03-06NIL

LibraryMember

Page 50: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 50

Interaction Diagram

• Models how groups of objects collaborate to realize some behaviour

• Typically each interaction diagram realizes behaviour of a single use case

• Demonstrates collaboration between the different objects.

Page 51: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 51

Interaction Diagram• Two kinds:

–Sequence and Collaboration diagrams.• Two diagrams are equivalent

– Portray different perspectives• These diagrams play a very important role in the design

process.• Sequence Diagram displays the time sequence of the

objects participating in the interaction.• Collaboration Diagram displays an interaction organized

around the objects and their links to one another.

Page 52: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 52

Sequence Diagram

• A sequence diagram is • An interaction diagram that

details how operations are carried out.

• What messages are sent and when.

• Sequence diagrams are organized according to time

Object: Class

Lifeline

Operations

Message

Page 53: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 53

Sequence Diagram• Shows interaction among objects as a two-

dimensional chart• Objects are shown as boxes at top• If object created during execution then shown

at appropriate place• Objects existence are shown as dashed lines

(lifeline)• Objects activeness, shown as a rectangle on

lifeline

Page 54: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 54

Sequence Diagram Cont…• Messages are shown as arrows.• Each message labelled with corresponding

message name.• Each message can be labelled with some

control information.• Two types of control information:

–condition ([])–iteration (*)

Page 55: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 55

Sequence Diagram NotationActor

Class

Synchronous messageAsynchronous message

Return message

Focus of Control

lifeline

Termination

Page 56: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 56

Elements of a Sequence Diagram

: C u s to m e r : O rd e r : P a y m e n t : P ro d u c t : S u p p lie r

p la c e a n o rd e r

p ro c e s s

v a lid a te

d e liv e r

if ( p a y m e n t o k )

b a c k o rd e r

if ( n o t in s to c k )

g e t a d d re s s

m a il to a d d re s s

message

lifetimecontrol

object

Page 57: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 57

Example Cont…

: C u s to m e r : O rd e r : P a y m e n t : P ro d u c t : S u p p lie r

p la c e a n o rd e r

p ro c e s s

v a lid a te

d e liv e r

if ( p a y m e n t o k )

b a c k o rd e r

if ( n o t in s to c k )

g e t a d d re s s

m a il to a d d re s s

Sequence of message sending

Page 58: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 58

:LibraryBoundary

:LibraryBookRenewalController

:LibraryBookRegister

:Book:LibraryMember

renewBook

displayBorrowing

selectBooks

[reserved]

apology

confirm

find MemberBorrowing

bookSelected* find

update

[reserved]

apology

confirm

updateMemberBorrowing

Sequence Diagram for the renew book use case

An Example ofA Sequence Diagram

Page 59: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 59

Collaboration DiagramsCollaboration Diagrams describe interactions among classes

and associations. These interactions are modeled as exchanges of messages between classes through their associations. Collaboration diagrams contain the following elements.

• Class roles, which represent roles that objects may play within the interaction.

• Association roles, which represent roles that links may play within the interaction.

• Message flows, which represent messages sent between objects via links. Links transport or implement the delivery of the message.

Page 60: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 60

COLLABORATION DIAGRAM - PURPOSE

• Collaboration Diagrams are useful when we want to refer to a particular interaction.

• To illustrate the coordination of object structure and flow of control.

Page 61: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 61

Collaboration Diagram • Shows both structural and behavioural aspects• Objects are collaborator, shown as boxes• Messages between objects shown as a solid

line• A message is shown as a labelled arrow placed

near the link• Messages are prefixed with sequence numbers

to show relative sequencing

Page 62: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 62

An Example ofA Collaboration Diagram

:LibraryBoundary

:LibraryBookRenewalController

:LibraryBookRegister

:Book

:LibraryMember

1: renewBook

3: displayBorrowing

4: selectBooks

[reserved]

8: apology

12: confirm

2: findMemberBorrowing

5: bookSelected

6: * find

9: update[reserved]

7: apology

10: confirm

updateMemberBorrowing

Collaboration Diagram for the renew book use case

Page 63: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 63

COLLABORATION DIAGRAM VS SEQUENCE DIAGRAM

Both show the interaction between the objects\classes.

• If time is the most important aspect to emphasize, choose sequence diagrams.

• If the role is the most important aspect to emphasize, choose collaboration diagram

Page 64: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 64

Activity Diagram

• Displays a workflow behavior of a system.• Somewhat similar to a state diagram• Activities are states that represent the

performance of actions or sub-activities.• Transitions are triggered by the completion of

actions or sub-activities.

Page 65: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 65

Activity Diagram

• Not present in earlier modelling techniques:– Possibly based on event diagram of Odell [1992]

• Represents processing activity, may not correspond to methods

• Activity is a state with an internal action and one/many outgoing transitions

• Somewhat related to flowcharts

Page 66: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 66

Activity Diagram

Activity diagram notations:• Swimlane – Used to organize responsibility for actions

and subactivities. Often corresponds to organizational units in a business model.

• Fork - Splits an incoming transition into several concurrent outgoing transitions. All of the transitions fire together.

• Join - Merges transitions from concurrent regions into a single outgoing transition. All the transitions fire together.

• Decision – A state node that represents a decision. Each transition from this node depends on a Boolean condition.

Page 67: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 67

Activity Diagram

Activity diagrams describe the workflow behaviour of a system

StartFork

Branch

MergeJoint

End

Page 68: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 68

Activity Diagram vs Flow Chart

• Can represent parallel activity and synchronization aspects

• Swim lanes can be used to group activities based on who is performing them

• Example: academic department vs. hostel

Page 69: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 69

Activity Diagram

• Normally employed in business process modelling.

• Carried out during requirements analysis and specification stage.

• Can be used to develop interaction diagrams.

Page 70: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 70

An Example of An Activity Diagram

checkstudentrecords

Academic Section

receivefees

allotroom

receivefees

allothostel

createhospitalrecord

conductmedical

examination

registerin

course

Accounts Section Hostel Office Hospital Department

issueidentity card

Activity diagram for student admission procedure at IIT

Page 71: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 71

Activity Diagram: Example 2

ReceiveOrder

AuthorizePayment

CancelOrder

CheckLine Item

ReorderItem

Assign toOrder

AssignGoods to

Order

DispatchOrder

ChooseOutstandingOrder Items

Finance

ReceiveSupply

[failed]

[succeeded]

[in stock]

*[for each line item on order]

[need to reorder]

[all outstandingorder items filled]

* [for each chosen order item]

[stock assigned to all line items and payment authorized]

OrderProcessing

StockManager

Page 72: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 72

State Chart Diagram • Based on the work of David Harel [1990]

• Model how the state of an object changes in its lifetime

• Based on finite state machine (FSM) formalism

Page 73: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 73

State Chart Diagram Cont…

• State chart avoids the problem of state explosion of FSM.

• Hierarchical model of a system:–Represents composite nested

states.

Page 74: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 74

State Chart Diagram• A state chart diagram shows the states of a single object, the events or the

messages that cause a transition from one state to another and the action that result from a state change.

• A state chart diagram will not be created for every class in the system. Components of State Chart Diagram:

– Start State– Other states– Stop state– State Transition

Page 75: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 75

Semantics of every components

• State: A state is a condition during the life of an object when it satisfies some condition, performs some action, or waits for an event.The UML notation for a state is a rectangle with rounded corners.

• Special states : There are two special states.

-- Start state: Each state chart diagram must have one and only one start state. Notation for start state is “filled solid circle”.

-- Stop State: An object can have multiple stop states. Notation for stopstate is bull’s eye.

• State transition: A state transition represents a change from an originating to a successor state.

• Transition label: • event name[guard condition] / action

Page 76: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 76

State Machine Diagram

A State Machine diagramshows the possible states ofthe object and the transitionsthat cause a change in state.

? What is different between activities and Statemachine diagram

Page 77: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 77

State Chart Diagram Cont…

• Elements of state chart diagram• Initial State: A filled circle• Final State: A filled circle inside a larger circle• State: Rectangle with rounded corners• Transitions: Arrow between states, also

boolean logic condition (guard)

Page 78: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 78

An Example of A State Chart Diagram

UnprocessedOrder

FulfilledOrder

PendingOrder

AcceptedOrder

RejectedOrder

order received

[reject] checked [accept] checked

[some items notavailable] processed

[all itemsavailable] newsupply

[some items available] processed / deliver

Example: State chart diagram for an order object

Page 79: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 79

Implementation Diagram

• show aspects of physical implementation:– Structure of components.– Run-time deployment systems.

• Two diagram types:• Component diagram – show the structure of

components, including the classifiers that specify them and the artifacts that implement them.

• Deployment diagram - show the structure of the nodes on which the components are deployed.

• These two diagrams are usually drawn together.

Page 80: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 80

Component diagram• Component diagrams describe the organization of and

dependencies among software implementation components. • These diagrams contain components, which represent

distributable physical units, including source code, object code, and executable code.

• Built as part of architectural specification

• Purpose– Organize source code– Construct an executable release– Specify a physical database

• Developed by architects and programmers

Page 81: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 81

Component Diagram• Captures the physical structure of the

implementation (code components)

Components:

• Executables

• Library

• Table

• File

• Document

dependency

Page 82: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 82

Deployment diagram

• Deployment diagrams describe the configuration of processing resource elements and the mapping of software implementation components onto them.

• These diagrams contain components and nodes, which represent processing or computational resources, including computers, printers, etc.

Page 83: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 83

Deployment Diagram• Captures the topology of a system’s

hardware

A piece of hardware

Page 84: Uml

Package • A package is a grouping of several

classes:– Java packages are a good example

• Package diagrams show module dependencies.

• Useful for large projects with multiple binary files

DatabaseInterface{abstract}

OracleInterface

SybaseInterface

Common{global}

QuantityMoneyDateRange

Domain

Orders Customers

Order CaptureApplication

Order CaptureUI AWT Mailing List

UI

Mailing ListApplication

Dependency

Page 85: Uml

04/09/2023 KIIT SCHOOL of COMPUTER ENGINEERING 85

NOFor a simple system:

Use case diagram, class diagram and one of the interaction diagrams only.

State chart diagram: when class has significant states. When states are only one or two, state chart model

becomes trivialDeployment diagram:

In case several hardware components used to develop the system.

Are All Views Required for Developing A Typical System?