+ All Categories
Home > Documents > Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling...

Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling...

Date post: 04-Jan-2016
Category:
Upload: leon-shelton
View: 220 times
Download: 2 times
Share this document with a friend
20
Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object- oriented software by providing a standard notation methods, selecting and integrating the best elements.
Transcript
Page 1: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

Modeling with UMLThe Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard notation methods, selecting and integrating the best elements.

Page 2: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

System Development ModelIt focuses on three different modes of the system that are represented in UML. These include:• Functional model that describes the functionality of the system from the users point of view.• Object model that describes the structure of the system in terms of objects, attributes, association, and operations

Page 3: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

• Dynamic model that describes the internal behavior(like exchange of messages among objects) in the system.

Page 4: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

Five Basic Notations of UML

1.Use case diagrams2.Class diagrams3.Interaction diagrams4.Statechart diagrams5.Activity diagram

Page 5: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

Use case diagrams provide a description of interaction between the users of the system termed actor and the high level functions within the system use case. These descriptions can be in summary or detailed form in which the interaction between the actor and the use case is descried in a step-by- step way.

Page 6: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

S

ReadTime

SetTime

ChangeBattery

SimpleWatch

WatchUser WatchRepairPerson

System boundaryCommunicationassociation

Page 7: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

From the above diagram, the Watchuser(actor) may either consult the time of his/her watch using ReadTime(use case) or SetTime(another use Case). However, only the WatchRepairPerson(actor) can change the battery of the watch with ChangeBattery(use case).

Page 8: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

Staff management

Accountant

S

Add a new staff member

Add a new staff grade

Change the rate for a staff grade

Calculate staff bonuses

Page 9: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

Class diagrams describes the data found in a software. A class is represented as a box with its name written inside.The name should always be in singular and start with a capital letter( i.e when a class diagram is drawn,the system will contain a class diagram by that name, when the system runs, instances of the class will be created). It may also show the attributes and operations contained in each class.

Page 10: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

Rectangle

e.g.

RectangleRectangle

get

Rectangle

getArea()

Resize()

height

width

height Width

getArea() Getsize()

The above diagram illustrates a class drawn at different levels of detail. How much you show depends on the phase of development and on what you wish to communicate. The 1st diagram shows only the class name while others show the class name & operation, class name &

Page 11: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

Attributes, class name, attributes & operation respectively.Interaction diagrams show how a set of actors and objects communicate with each other to perform the steps of a use case or of some other piece of functionality. The systems taken together is referred to as interaction while the communication shared ( like exchange of messages , commands) issue by actor through the to user interface are referred to as messages.

Page 12: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

Elements that can be found in interaction diagrams are:

Instances of classes or actors: instances of classes(i.e. are shown as boxes with the class and object identifier underlined. Actors are shown using same stick-person symbol as used in use case diagrams.

Page 13: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

Messages are shown as arrows from actor to object or from object to object so as to understand the sequence of messages better.

Note that it is advisable to always develop a class diagram and use case model before starting an interaction diagram(i.e. Knowing the actors and the objects involved).

Page 14: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

e.g a student(actor) register in a course using the objects: student, course section and registration.

requestToRegister()getPrerequisite()

Course CourseSelection Registration

addToRegistration()

hasPassedCourse()

Student

addToScedule()

Page 15: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

:Registration :CourseSection :Student

requestToRegister

AddToRegistrationList

Create

Interaction diagram of the class diagram.

Page 16: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

Statechart diagrams are used to describe the external visible behaviour of a system or of am individual object.At any given point in time, the system or the object is said to be in certain state. It remains in this state until an event occurs that causes it to change state. It is represented by a rounded rectangle that contains the name of the state.

Page 17: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

XTurn

XWin

OTurn

OWin

Tie

Statechart diagram of noughts and crosses game.

From the above diagram, player X goes 1st, so the initial transition is from the start state points to Xturn. Then the game alternates between Xturn and Oturn states until the game ends. Three possible outcomes of the game represented by the end states include:

i.X can win.ii.O can win.iii.There can be a tie which can be reached from both Xturn state and Oturn state.

Page 18: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

Activity diagrams are used to understand the flow of work that an object or component performs. It is like a statechart diagram except that it has a few additional symbols used in a different context.

The difference between statechart and activity diagram.Most transactions are caused by the external events in a statechart diagram while most transactions are internal events in an activity

Page 19: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

diagram.There are two types of nodes for branching thread in an activity diagram:

• Decision node which has one incoming and multiple outgoing transition taken.• Merger node has two incoming transitions and one outgoing transition used in bringing paths that had been splitted by the decision nodes together.

Page 20: Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.

Receive course registration request

[NotFull]

[doesNotHavePrerequisite]

Complete Registration

Check special permission

Verify course not full

Check Prerequisites

[NoPermission]

[HasPrerequisites]

Full

An activity diagram of the registration process.


Recommended