Se Lab Final
Se Lab Final
A brief description on the symbols used in the sequence diagram explaining the reason for the usage of
that particular symbol.
Messages
Messages are arrows that represent communication between objects. Use half-arrowed lines to represent
asynchronous messages. Asynchronous messages are sent from an object that will not wait for a response
from the receiver before continuing its tasks. For message types, see below.
Lifelines
Lifelines are vertical dashed lines that indicate the object's presence over time.
Destroying Objects
Objects can be terminated early using an arrow labeled "<< destroy >>" that points to an X. This object is
removed from memory. When that object's lifeline ends, you can place an X at the end of its lifeline to
denote a destruction occurrence.
Loops
A repetition or loop within a sequence diagram is depicted as a rectangle. Place the condition for exiting
the loop at the bottom left corner in square brackets [ ].
Types of Messages in Sequence Diagrams
Synchronous Message
A synchronous message requires a response before the interaction can continue. It's usually drawn using a
line with a solid arrowhead pointing from one object to another.
Asynchronous Message
Asynchronous messages don't need a reply for interaction to continue. Like synchronous messages, they
are drawn with an arrow connecting two lifelines; however, the arrowhead is usually open and there's no
return message depicted.
Self Message
A message an object sends to itself, usually shown as a U shaped arrow pointing back to itself.
Create Message
This is a message that creates a new object. Similar to a return message, it's depicted with a dashed line
and an open arrowhead that points to the rectangle representing the object created.
Delete Message
This is a message that destroys an object. It can be shown by an arrow with an x at the end.
Found Message
A message sent from an unknown recipient, shown by an arrow from an endpoint to a lifeline.
Lost Message
A message sent to an unknown recipient. It's shown by an arrow going from a lifeline to an endpoint, a
filled circle or an x.
Collaboration diagrams are used to show how objects interact to perform the behavior of a particular use
case, or a part of a use case. Along with sequence diagrams, collaborations are used by designers to define
and clarify the roles of the objects that perform a particular flow of events of a use case. They are the
primary source of information used to determining class responsibilities and interfaces.
Unlike a sequence diagram, a collaboration diagram shows the relationships among the objects. Sequence
diagrams and collaboration diagrams express similar information, but show it in different ways.
Collaboration diagrams show the relationships among objects and are better for understanding all the
effects on a given object and for procedural design.
You can have objects and actor instances in collaboration diagrams, together with links and messages
describing how they are related and how they interact. The diagram describes what takes place in the
participating objects, in terms of how the objects communicate by sending messages to one another. You
can make a collaboration diagram for each variant of a use case's flow of events.
A collaboration diagram that describes part of the flow of events of the use
case Receive Deposit Item in the Recycling-Machine System.
Objects
An object is represented by an object symbol showing the name of the object and its class underlined,
separated by a colon:
objectname :classname
● An object's class can be unspecified. Normally you create a collaboration diagram with objects first and
specify their classes later.
● The objects can be unnamed, but you should name them if you want to discriminate different objects
of the same class.
● An object's class can itself be represented in a collaboration diagram, if it actively participates in the
collaboration.
Actors
Normally an actor instance occurs in the collaboration diagram, as the invoker of the interaction. If you
have several actor instances in the same diagram, try keeping them in the periphery of the diagram.
Links
● A link is a relationship among objects across which messages can be sent. In collaboration diagrams, a
link is shown as a solid line between two objects.
● An object interacts with, or navigates to, other objects through its links to these objects.
● A link can be an instance of an association, or it can be anonymous, meaning that its association is
unspecified.
● Message flows are attached to links, see Messages.
Messages
A message is a communication between objects that conveys information with the expectation that activity
will ensue. In collaboration diagrams, a message is shown as a labeled arrow placed near a link. This means
that the link is used to transport, or otherwise implement the delivery of the message to the target object.
The arrow points along the link in the direction of the target object (the one that receives the message).
The arrow is labeled with the name of the message, and its parameters. The arrow may also be labeled
with a sequence number to show the sequence of the message in the overall interaction. Sequence
numbers are often used in collaboration diagrams, because they are the only way of describing the relative
sequencing of messages.
EXPERIMENT-7
AIM: Draw the state chart diagram.
THEORY:
The name of the diagram itself clarifies the purpose of the diagram and other details. It describes different
states of a component in a system. The states are specific to a component/object of a system.
A Statechart diagram describes a state machine. State machine can be defined as a machine which defines
different states of an object and these states are controlled by external or internal events.
Activity diagram explained in the next chapter, is a special kind of a Statechart diagram. As Statechart
diagram defines the states, it is used to model the lifetime of an object.
Statechart diagram describes the flow of control from one state to another state. States are defined as a
condition in which an object exists and it changes when some event is triggered. The most important
purpose of Statechart diagram is to model lifetime of an object from creation to termination.
Statechart diagrams are also used for forward and reverse engineering of a system. However, the main
purpose is to model the reactive system.
● Following is an example of a Statechart diagram where the state of Order object is analyzed
● The first state is an idle state from where the process starts. The next states are arrived for events
like send request, confirm request, and dispatch order. These events are responsible for the state
changes of order object.
The main usage can be described as
Component diagrams are used to visualize the organization and relationships among components in a
system. These diagrams are also used to make executable systems.
A single component diagram cannot represent the entire system but a collection of diagrams is used to
represent the whole.
● In the following diagram, four files are identified and their relationships are produced. Component
diagram cannot be matched directly with other UML diagrams discussed so far as it is drawn for
completely different purpose.
● The following component diagram has been drawn considering all the points mentioned above.
Component diagrams are very important from implementation perspective. Thus, the implementation
team of an application should have a proper knowledge of the component details
●
● All of these classes specify a mapping to Java, as noted in their stereotype. Forward engineering the
classes in this diagram to Java is straightforward, using a tool. Forward engineering the
class EventHandler yields the following code.
● public abstract class EventHandler {
●
● EventHandler successor;
● private Integer currentEventID;
● private String source;
●
● EventHandler() {}
● public void handleRequest() {}}
EXPERIMENT-10
Deployment diagrams are used to describe the static deployment view of a system. Deployment diagrams
consist of nodes and their relationships.
Component diagrams are used to describe the components and deployment diagrams shows how they
are deployed in hardware.
UML is mainly designed to focus on the software artifacts of a system. However, these two diagrams are
special diagrams used to focus on software and hardware components.
Most of the UML diagrams are used to handle logical components but deployment diagrams are made to
focus on the hardware topology of a system. Deployment diagrams are used by the system engineers.
Deployment diagrams are useful for system engineers. An efficient deployment diagram is very important as it cont
● Performance
● Scalability
● Maintainability
● Portability
● Nodes
Following is a sample deployment diagram to provide an idea of the deployment view of order management system
● Monitor
● Modem
● Caching server
● Server
The following deployment diagram has been drawn considering all the points mentioned above.