8 - Se Week-3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

WEEK-3 Introduction to UML

The unified modeling language (UML) is a standard language for writing


software blueprints of the system.

Definition: The UML is a language for

• Visualizing

• Specifying

• Constructing

• Documenting the objects of a software system.

UML is a language that provides vocabulary and the rules for combing words in
that vocabulary for the purpose of communication.

Vocabulary and rules of a language tell us how to create and real well-formed
models, but they don’t tell you what model you should create and when should
create them.

Model

• A model is a simplification of reality.


• A model provides the blueprints of a system.
• A model may be structural, emphasizing the organization of the system, or
it may be behavioral, emphasizing the dynamics of the system.

Why do we model

We build models so that we can better understand the system we are developing.

Building blocks of UML

Building blocks of UML are divided into:

1. Things
2. Relationships

3. Diagrams

1. Things in the UML: There are four kinds of things in the UML:

i. Structural things

ii. Behavioral things

iii. Grouping things

iv. Annotational things


i. Structural things are the nouns of UML models. These are the static
parts of a model, representing elements that are either conceptual or
physical. In all, there are seven kinds of structural things.

a. Classes

b. Interfaces

c. Collaborations

d. Use cases

e. Active classes

f. Components

g. Nodes

a. Class: Class is a description of a set of objects that share the same


attributes, operations, relationships, and semantics. A class implements one
or more interfaces. Graphically, a class is rendered as a rectangle, usually
including its name, attributes, and operations.
b. Interface: Interface is a collection of operations that specify a service of
a class or component. An interface therefore describes the externally
visible behavior of that element. An interface might represent the complete
behavior of a class or component or only a part of that behavior.

An interface is rendered as a circle together with its name. An


interface rarely stands alone. Rather, it is typically attached to the class or
component that realizes the interface.

ISpelling

c. Collaboration: Collaboration defines an interaction and is a society of


roles and other elements that work together to provide some cooperative
behavior. Therefore, collaborations have structural, as well as behavioral,
dimensions. A given class might participate in several collaborations.

Graphically, a collaboration is rendered as an ellipse with dashed


lines, usually including only its name.

d. Use case: Use case is a description of set of sequence of actions that a


system performs that yields an observable result of value to a particular
actor. Use case is used to structure the behavioral things in a model. A use
case is realized by a collaboration. Graphically, a use case is rendered as
an ellipse with solid lines, usually including only its name.
Active class: Active class is a class whose objects own one or more
processes or threads. An active class is just like a class except that its
objects represent elements whose behaviour is concurrent with other
elements.
Graphically, an active class is rendered just like a class, but with
heavy lines, usually including its name, attributes, and operations.

e. Component: Component is a physical and replaceable part


of a system that conforms to and provides the realization of
a set of interfaces. Graphically, a component is rendered as
a rectangle with tabs.

f. Node: Node is a physical element that exists at run time and


represents a computational resource, generally having at
least some memory and, often, processing capability.
Graphically, a node is rendered as a cube, usually including
only its name.
ii. Behavioral Things: Behavioral Things are the dynamic parts of
UML models. These are the verbs of a model, representing behavior
over time and space. In all, there are two primary kinds of behavioral
things.

a. Interaction

b. state machine

a. Interaction: Interaction is a behavior that comprises a set of messages


exchanged among a set of objects within a particular context to
accomplish a specific purpose. An interaction involves a number of
other elements, including messages, action sequences and links.

Graphically a message is rendered as a directed line, almost always

including the name of its operation


b. State Machine: State machine is a behavior that specifies the sequences
of states an object or an interaction goes through during its lifetime in
response to events, together with its responses to those events. State
machine involves a number of other elements, including states,
transitions, events, and activities.
Graphically, a state is rendered as a rounded rectangle, usually

including its name.

iii. Grouping Things: These are the organizational parts of UML


models. These are the boxes into which a model can be decomposed.
There is one primary kind of grouping thing, namely, packages.
a. Package: A package is a general-purpose mechanism for
organizing elements into groups. Structural things, behavioral
things, and even other grouping things may be placed in a
package.
Graphically, a package is rendered as a tabbed folder, usually
including only its name and, sometimes, its contents.

iv. Annotational Things: Annotational things are the explanatory parts


of UML models. These are the comments you may apply to describe
about any element in a model.
A note is simply a symbol for rendering constraints and comments
attached to an element or a collection of elements.
Graphically, a note is rendered as a rectangle with a dog-eared
corner, together with a textual or graphical comment.

2. Relationships in the UML: There are four kinds of relationships in the


UML:
I. Dependency
II. Association
III. Generalization
IV. Realization
i. Dependency: -
Dependency is a semantic relationship between two things in which a
change to one thing may affect the semantics of the other thing.
Graphically a dependency is rendered as a dashed line, possibly
directed, and occasionally including a label.

Association is a structural relationship that describes a set of links, a link


being a connection among objects.
Graphically an association is rendered as a solid line, possibly
directed, occasionally including a label, and often containing other

adornments, such as multiplicity and role names.


Aggregation is a special kind of association, representing a structural
relationship between a whole and its parts.
Graphically, a generalization relationship is rendered as a solid line

with an open diamond at the whole end.


Generalization is a specialization/generalization relationship in which
objects of the child are substitutable for the objects of the parent.
Graphically, a generalization relationship is rendered as a solid line
with a hollow arrowhead pointing to the parent.

Realization is a semantic relationship between classifiers, wherein one


classifier specifies a contract that another classifier guarantees to carry out.
Graphically a realization relationship is rendered as a cross between a
generalization and a dependency relationship.
3. Diagrams in the UML:
• Diagram is the graphical presentation of a set of elements, most often
rendered as a connected graph of vertices (things) and arcs (relationships).
• In theory, a diagram may contain any combination of things and
relationships.
For this reason, the UML includes nine such diagrams:
1. Class diagram
2. Object diagram
3. Use case diagram
4. Sequence diagram
5. Collaboration diagram
6. Statechart diagram
7. Activity diagram
8. Component diagram
9. Deployment diagram

1) Class diagram
A class diagram shows a set of classes, interfaces, and collaborations and
their relationships. Class diagrams address the static design view of a
system. Class diagrams that include active classes address the static
process view of a system.
2) Object diagram
Object diagrams represent static snapshots of instances of the things found
in class diagrams. These diagrams address the static design view or static
process view of a system. An object diagram shows a set of objects and
their relationships
3) Use case diagram
A use case diagram shows a set of use cases and actors and their
relationships. Use case diagrams address the static use case view of a
system. These diagrams are especially important in organizing and
modeling the behaviors of a system.
4) Interaction Diagrams
An interaction diagram shows an interaction, consisting of a set of objects
and their relationships. Including the messages that may be dispatched
among them. Interaction diagrams address the dynamic view of a system.
Both sequence diagrams and collaboration diagrams are kinds of
interaction diagrams. Sequence diagrams and collaboration diagrams are
isomorphic, meaning that you can take one and transform it into the other
I. A Sequence diagram is an interaction diagram that emphasizes the
time- ordering of messages.
II. A collaboration diagram is an interaction diagram that emphasizes
the structural organization of the objects that send and receive
messages.
5) Statechart diagram
A statechart diagram shows a state machine, consisting of states,
transitions, events, and activities. Statechart diagrams address the
dynamic view of a system. They are especially important in modeling the
behavior of an interface, class, or collaboration and emphasize the event-
ordered behavior of an object.
6) Activity diagram
An activity diagram is a special kind of a statechart diagram that shows
the flow from activity to activity within a system. Activity diagrams
address the dynamic view of a system. They are especially important in
modeling the function of a system and emphasize the flow of control
among objects.
7) Component diagram
A component diagram shows the organizations and dependencies among
a set of components. Component diagrams address the static
implementation view of a system. They are related to class diagrams in
that a component typically maps to one or more classes, interfaces, or
collaborations.
8) Deployment diagram
A deployment diagram shows the configuration of run-time processing
nodes and the components that live on them. Deployment diagrams
address the static deployment view of an architecture

You might also like