0% found this document useful (0 votes)
127 views89 pages

Software Engineering Ii: Modeling Diagrams

The document discusses modeling diagrams in software engineering II, focusing on activity diagrams and sequence diagrams. It provides examples of the basic symbols and concepts used in activity diagrams like activities, transitions, decisions, concurrent paths, and swimlanes. It also covers the key elements of sequence diagrams such as objects, messages, synchronous/asynchronous messages, creation/destruction messages, combined fragments, and examples of sequence diagrams.

Uploaded by

CREATIVE QUOTES
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
127 views89 pages

Software Engineering Ii: Modeling Diagrams

The document discusses modeling diagrams in software engineering II, focusing on activity diagrams and sequence diagrams. It provides examples of the basic symbols and concepts used in activity diagrams like activities, transitions, decisions, concurrent paths, and swimlanes. It also covers the key elements of sequence diagrams such as objects, messages, synchronous/asynchronous messages, creation/destruction messages, combined fragments, and examples of sequence diagrams.

Uploaded by

CREATIVE QUOTES
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 89

SOFTWARE ENGINEERING II

Modeling Diagrams

Basic concepts and symbols of UML notations


(Activity Diagram)
Activity Diagram
Activity Diagram
• The activity diagram is much like the
flowcharts of old. It shows steps (activities) as
well as decision points and branches. It is
useful for showing what happens in a business
process or an operation.
The Basics: What is an Activity
Diagram
• Each activity is represented by a rounded rectangle—
narrower and more oval-shaped.
• The processing within an activity goes to completion
and then an automatic transmission to the next activity
occurs.
• An arrow represents the transition from one activity to
the next.
• The activity diagram has a starting point represented by
a filled-in circle and an endpoint represented by a
bull's-eye.
Transitioning from one activity to
another
Basic symbols
Basic symbols
Basic symbols
Time Event
This refers to an event that stops the flow for a time; an hourglass
depicts it.

Sent and Received Signals


Signals represent how activities can be modified from outside the
system. They usually appear in pairs of sent and received signals,
because the state can't change until a response is received, much
like synchronous messages in a sequence diagram. For example, an
authorization of payment is needed before an order can be
completed.
Decisions
• A sequence of activities almost always comes to a point where
a decision has to take place.
• One set of conditions leads to one path, another set of
conditions to another path, and the two paths are mutually
exclusive.
• You can represent a decision point in either of two ways.
• One way is to show the possible paths coming directly out of
an activity.
• The other is to have the activity transition to a small diamond
—reminiscent of the decision symbol in a flowchart—and
have the possible paths flow out of the diamond.
The two ways of showing a
decision
Concurrent Paths
• As you model activities, you'll occasionally have to
separate a transition into two separate paths that run
at the same time (that is, concurrently) and then come
together.
• To represent the split, you use a solid bold line
perpendicular to the transition and show the paths
coming out of the line.
Representing a transition split into two paths that run
concurrently and then come together
Object Nodes
• Object change state during or as result of some
process.
• Activity diagram can show status of object at
various point in given process.
Signals
• During a sequence of activities, it’s possible to
send a signal. When received, the signal causes
an activity to take place. The symbol for
sending a signal is a convex polygon, and the
signal for receiving a signal is concave polygon.
• In UML term, convex polygon symbolizes an
output event; the concave polygon symbolizes
an input event.
Sending and receiving a signal
Sub activity diagram
• Sub activity diagram allows to decompose the
functionality in an activity diagram.
• Lets you show an action in more detail.
Example
A Process: Creating a Document
Think of the activities that go into using an office software suite to create a document. One
possible sequence of activities is
1.Open the word processing package.
2.Create a file.
3.3. Save the file under a unique name within its directory.
4.Type the document.
5.If graphics are necessary, open the graphics package, create the graphics, and
paste the graphics into the document.
6.If a spreadsheet is necessary, open the spreadsheet package, create the
spreadsheet, and paste the spreadsheet into the document.
7.Save the file.
8.Print a hard copy of the document.
9.Exit the office suite
An activity diagram
for the process of
creating a
document
Swimlanes

• One of the handier aspects of the activity


diagram is its ability to expand and show who
has the responsibility for each activity in a
process.
Example Swimlanes

Consider a consulting firm and the business process involved in meeting a new
client. The activities would occur like this:

1.A salesperson calls the client and sets up an appointment.


2.If the appointment is onsite (in the consulting firm's office), corporate
technicians prepare a conference room for a presentation.
3.If the appointment is offsite (at the client's office), a consultant prepares a
presentation on a laptop.
4.The consultant and the salesperson meet with the client at the agreed-upon
location and time.
5.The salesperson follows up with a letter.
6.If the meeting has resulted in a statement of a problem, the consultant creates
a proposal and sends it to the client.
An activity
diagram for the
business
process of
meeting a new
client
The swimlane
version of the
activity diagram
shows the activities
that each role
performs
Using the Note Symbol
• Both activity diagrams for "Meeting a new client"
show creating a proposal as an activity. In each case,
that activity could attach to a note that cites the
activity diagram for creating a document.
Hybrid diagrams
Task
• An example of business flow activity of order
processing, Requested order is input parameter
of the activity. After order is accepted and all
required information is filled in, payment is
accepted and order is shipped.
SOFTWARE ENGINEERING II

Modeling Diagrams

Basic concepts and symbols of UML notations


(Sequence Diagram)
Interaction Diagrams
Interaction diagrams are used to describe some type
of interactions among the different elements in the
model. This interaction is a part of dynamic
behavior of the system.

This interactive behavior is represented in UML by


two diagrams known as Sequence
diagram and Collaboration/Communication
diagram. 
Sequence Diagram
• The sequence diagram consists of objects
represented in the usual way (as named
rectangles with the name underlined),
messages represented as solid-line arrows, and
time represented as a vertical progression
Objects
• The objects are laid out near the top of the diagram from
left to right..

• Extending downward from each object is a dashed line


called the object's lifeline.

• Along the lifeline is a narrow rectangle called an


activation. The activation represents an execution of
an operation the object carries out. The length of
the rectangle signifies the activation's duration.
Representing an Object
Time
• The diagram represents time in the vertical direction:
Time starts at the top and progresses toward the
bottom.
• Thus, the sequence diagram is two-dimensional. The
left-to-right dimension is the layout of the objects,
and the top-to-bottom dimension shows the
passage of time.
Messages
• A message that goes from one object to another goes
from one object's lifeline to the other object's lifeline.
• An object can also send a message to itself—that is,
from its lifeline back to its own lifeline.

• Type of Messages in Sequence Diagrams


– Synchronous
– Asynchronous
– Recursive
Synchronous Message
One type of message is a call. This is a request
from the object sending the message to the object
receiving the message. The request is for the
receiver to carry out one of its (the receiver's)
operations. Because the sender waits for the receiver
(that is, "synchs up" with the receiver), this message
is also referred to as synchronous.
Asynchronous Message
• With this one, the sender transfers control to the
receiver and doesn't wait for the operation to
complete
Recursive Message
Symbols in a Sequence Diagram
Creation Message
Element Creation: when an element is created during an
interaction, the communication that creates the element is shown
with its arrowhead to the element.
Destruction Message
Element Destruction: When an element is destroyed during an
interaction, the communication that destroys the element is shown
with its arrowhead to the elements lifeline where the destruction is
marked with a large × symbol.
Message Type Notations
Message Type Notations
Boundary, Entity and Control elements
A lifeline with a boundary element indicates a system
boundary/ software element in a system; for example user
interface screens or menus that users interact with.
Boundary, Entity and Control elements
A lifeline with an entity element represents system data.
Boundary, Entity and Control elements
A lifeline with a control element indicates a controlling
entity or manager. 
Example
Another Example

Model of a Soda Machine


A sequence diagram that models the best
case scenario of Buy- Soda use case
A sequence diagram that models the
sold-out scenario of Buy- Soda use case
A sequence diagram that models the incorrect-
change scenario of Buy- Soda use case
A generic sequence diagram of Buy- Soda
use case
Combined Fragment in SD
• Combined fragment is about fragmenting sequence into
different parts and combining those to show larger sequence.

• UML 2 introduces this concept.

• Through the use of combined fragments the user will be able


to describe a number of traces in a compact and concise
manner.
Sequence Fragments
Common Operators for Interaction
Frames
Alternatives
Contains a list of fragments that contain alternative sequences
of messages. Only one sequence occurs on any occasion.
Option
the fragment executes only if the supplied condition is true.
Equivalent to an alt only with one trace.  
Loop
The fragment repeats some number of times. You can
indicate in the guard the condition under which it should
repeat.
Parallel
The interaction operator par defines potentially parallel
execution of behaviors of the operands of the combined
fragment.
Sequence diagram example
Communication Diagram
• Collaboration/ Communication Diagrams
captures dynamic behavior of the objects in
the system (message-oriented).
• They are very useful for visualizing the
relationship between objects collaborating to
perform a particular task.
Self and Parallel Message
• A message can be sent from an object to itself.
• This is illustrated by a link to itself, with
messages flowing along the link.
Iteration or Looping
This expresses that the message is being
sent repeatedly in a loop to the receiver.
Nested Messages
Sequence to Communication Diagram
Sequence to Communication Diagram
Sequence Diagrams vs. Communication
• UML specification is more sequence diagram centric.
• it is easier to see the call-flow sequence with
sequence diagrams—simply read top to bottom.
• With communication diagrams we must read the
sequence numbers, such as "1:" and "2:“
• communication diagrams are much more space-
efficient. The boxes can be easily placed or erased
anywhere—horizontal or vertical– modify easily.
Sequence Diagrams vs. Communication
Assignment #2
• Draw Sequence Diagram of an ATM for Cash
Withdrawal.
• Convert it into Communication Diagram.
Component Diagram
Component
• A software component is a modular part of a
system. Because it's the software implementation
of one or more classes, a component resides in a
computer.

• A component provides interfaces to other


components.
• They provide reusability (you can build it for one
system and reuse it in another)
Artifact
• A component, by contrast, defines a system's
functionality.
• Just as a component is the implementation of
one or more classes, an artifact (if it's
executable) is the implementation of a
component.
Interface
• An interface is a set of operations that allows you to access
a class's behavior—like the control knob that enables you to
get a washing machine to perform washing machine–related
operations.
• The interface is a set of operations that a class presents to
other classes.
• The component that offers the services is said to present a
provided interface. The component that accesses the
services is said to use a required interface.
• You can reach components operation only through its
interfaces.
Component Diagram
• A component diagram contains—appropriately
enough—components, along with interfaces
and relationships.
The component icon in UML 1.x and the two
versions of the component icon in UML 2.0
Adding information to the
component icon
Modeling the relationship between an artifact and a
component
You can represent an interface as a rectangle that
contains information, connected to the component by
a realization arrow
You can represent an interface as a small circle
connected to the component by a solid line
Two ways of showing realization and dependency in
the same diagram (Black Box view)
EXTERNAL VIEW
 A component have an external view and an internal
view

• An external view (or black box


view) shows publicly visible
properties and operations

 An external view of a component is


by means of interface symbols
sticking out of the component box

 The interface can be listed in the


compartment of a component box
INTERNAL VIEW

• An internal, or white box


view of a component is
where the realizing
classes/components are
nested within the
component shape

 Realization is a relationship between two set of


model elements
 One represents a specification
 The other represent an implementation of the
latter
INTERNAL VIEW

• The internal class that realize the


behavior of a component may be
displayed in an additional
compartment
 An artifact is the specification of a
phisycal piece of information
TASK 1
• Draw a Black Box and White box view of an
Order component. The component provides
the interfaces of OrderEntry and
AccountPayable. Additionally, the component
requires Person interface.
TASK 2
• Draw a Component Diagram for Order Management
System. The System contains three components:
• Order system (requires the interface of Product Accessor and
Customer Lookup)
• Customer repository (provides the interface of Customer Lookup)
• Inventory System (provides the interface of Product Accessor)
THE END

You might also like