LIBRARY
LIBRARY
LIBRARY
CONTENTS
Problem statement
ANALYSIS
Use case view
Identification of Actors.
Identification of Use cases and sub use cases.
Flow of Events.
Construction of Use case diagram.
Build a business process model using Activity diagram.
Logical view
Identification of Analysis classes.
Identification of attributes of classes.
Class - Attributes, operations & Relationships.
Construction of UML static Class diagram
Construction of Sequence diagrams.
Construction of Collaboration diagrams
Constructing UML state chart diagram.
DESIGN
Component view
Construction of component diagram.
Deployment view
Construction of deployment diagram.
ADVANTAGES OF UML
2
ACTOR: An actor is anything that interacts with a use case: human user, external hardware,
or another system. The term actor represents the role a user plays with respect to the system.
The actor in a system is represented as below.
NewClass
NewUseCase
4. Flow of events:
A flow of events is a sequence of transactions performed by the system. They
typically contain very detailed information, written in terms of what the system should do,
not how the system accomplishes the task. Flow of events are created as a separate files or
documents is your favorite text editor and then attached or linked to use case using the files
tab of a model element. A flow of events should include:
1 When and how the use case starts and ends?
2 Use case/ actor interactions?
3 Data needed by the use case?
4 Normal sequence of events for the use case?
5 Alternate or exceptional flows?
An activity diagram is used mostly to show the internal state of an object, but external
events may appear in them. An external event appears when the object is in a “waits state”, a
state during which there is no internal activity by the object and the object is waiting for some
external event to occur as the result of an activity by another object. The two states are wait
state and activity state. More then one possible event might take the object out of the wait
state; the first one that occurs triggers the transition. A wait state is the “normal” state.
Activity diagrams express a decision when conditions are used to indicate different
possible transitions that depend on Boolean conditions of container object. The figure
provided for a decision is the traditional diamond shape, with one or more incoming arrows
and two or more outgoing arrows, each labeled by a distinct guard condition. All possible
outcomes should appear on one of the outgoing transitions.
You can attach activity diagrams to most model elements in the use case or logical
views. Activity diagrams cannot reside within the component view.
6
Naming
The name of an activity must be unique and should declare the activity’s purpose. All
activity icons with the same name on an activity diagram represent the same activity.
Transition:
Is a relationship b/w two states indicating that an object in the 1 st state will perform certain
actions and enter the 2nd state when a specified event occurs and specified conditions are
satisfied.
On such a change of state, the transition is said to fire.
End State
An end state represents a final or terminal state on an activity diagram or state chart diagram.
Place an end state when you want to explicitly show the end of a workflow on an activity
diagram or the end of a state chart diagram. Transitions can only occur into an end state;
however, there can be any number of end states per context. You can label end states, if
desired. State Specifications are associated with each end state.
The end state icon is a filled circle inside a slightly larger unfilled circle that may contain a
name (End Process):
Start State
A start state (also called an "initial state") explicitly shows the beginning of a workflow on an
activity diagram or the beginning of the execution of a state machine on a state chart diagram.
You can have only one start state for each state machine because each workflow/execution of
a state machine begins in the same place. When you model nested states or nested activities,
one new start state can be created in each context. The start state icon is a small, filled circle
that may contain a name (Begin Process):
Swim lanes
Swim lanes are very similar to an object because they provide a way to tell who is performing
a certain role. Swim lanes only appear on activity diagrams. You should place activities
within swim lanes to determine which unit is responsible for carrying out the specific
activity.
When a swim lane is dragged onto an activity diagram, it becomes a swim lane view.
Synchronizations:
Synchronizations enable you to see a simultaneous workflow in an activity diagram or state
chart diagram. Synchronizations visually define forks and joins representing parallel
workflow.
8
login
browse for
book
search
another book
The sequence diagram is very simple and has immediate visual appeal---this is
its great strength. A sequence diagram is an alternative way to understand the over all flow of
control of a program. Instead of looking at the code and trying to find out the over all
sequence of behavior.
The following tools located on the sequence diagram toolbox, which enable to model
sequence diagram:
1. Object: An object has state, behavior and identity. The structure and behavior of
similar objects are defined in their common class. Each object in a diagram indicates
some instance of a class. An object that is not named is referred to as a class instance.
2. Message Icons: A message icon represents the communication between objects
indicating that an action will follow. The message icon is horizontal, solid arrow
connecting two-life line together.
3. Focus of Control: Focus of control (FOC) is an advanced notational technique that
enhances sequence diagram. It shows the period of time during which an object is
performing an action, either directly or through an underlying procedure.
4. Message to Self: A message to self is a tool that sends a message from one object
back to the same object. The sender of a message is the same as the receiver.
5. Note: A note captures the assumptions and decisions applied during analysis and
design. Notes may contain any information, including plain text, fragments of code, or
references to other documents.
6. Note Anchor: A note anchor connects a note to the element that it affects.
11
4: find availability
5: availability ok
The disadvantage of interaction diagrams is that they are great only for
representing a single sequential process; they begin to break down when you want to
12
4: find availability
8: update avilable copy 6: update issues
:title :book
5: avilable ok
The relationship among objects is based on the assumptions each makes about
other objects, including what operations can be performed and what behavior results.
Three types of relationships among objects are
Association:
Association represents a physical or conceptual connection between two or more
objects. The binary associations are shown as lines connecting two class symbols.
Ternary and higher – order associations are shown as diamonds connecting to a class
symbol by lines, and the association name is written above or below the line.
Identifying Associations:
Identifying associations begins by analyzing the interaction between classes. After
all, any dependency relationship between two or more classes is an association. You must
examine the responsibilities to determine dependencies. If an object is responsible for a
specific task and lacks all the necessary knowledge needed to perform the task, then the
object must delegate the task to another object that possesses such knowledge. The
following questions that can help us to identify associations.
Top down: Look for noun phrases composed of various adjectives in a class name. Avoid
excessive refinement. Specialize only when the subclasses have significant behavior.
Bottom-up: Look for classes with similar attributes or methods. In most cases, you can group
them by moving the common attributes and methods to an abstract class.
Reusability: Move the attributes and behaviors as high as possible in the hierarchy. At the
same time, do not create very specialized classes at the top of hierarchy. This is easier said
than done.
Multiple inheritances: Avoid excessive use of multiple inheritances. Multiple inheritance
brings with it complications such as how to determine which behavior to get from which
class, particularly when several ancestors define the same method. It also more difficult to
understand programs written in a multiple inheritance system. One way of achieving the
benefits of multiple inheritances is to inherit from the most appropriate class and add an
object of another class as an attribute.
A class diagram is a picture for describing generic descriptions of possible systems. Class
diagrams and collaboration diagrams are alternate representations of object models. Class
diagrams contain classes and object diagrams contain objects, but it is possible to mix classes
and objects when dealing with various kinds of metadata, so the separation is not rigid.
Class diagrams are more prevalent than object diagrams. Normally you will build
class diagrams plus occasional object diagrams illustrating complicated data structures or
message-passing structures.
Attribute:
An attribute is the description of a named slot of a specified type in class; each object of a
class separately holds a value of the type.
Method:
17
Relationship:
The relationship among objects is based on the assumptions each makes about
other objects, including what operations can be performed and what behavior results.
Three types of relationships among objects are
Association
Generalization
Aggregation
13.Analyzing the Object Behavior By Constructing UML State Chart
Diagram:
State chart diagrams model the dynamic behavior of individual classes or any other
kind of object. They show the sequences of states that an object goes through, the events that
cause a transition from one state to another and the actions that result from a state change.
State chart diagrams are closely related to activity diagrams. The main difference
between the two diagrams is state chart diagrams are state centric, while activity diagrams are
activity centric. A state chart diagram is typically used to model the discrete stages of an
object’s lifetime, whereas an activity diagram is better suited to model the sequence of
activities in a process.
Each state represents a named condition during the life of an object during which it
satisfies some condition or waits for some event. A state chart diagram typically contains one
start state and multiple end states. Transitions connect the various states on the diagram. As
with activity diagrams, decisions, synchronizations, and activities may also appear on state
chart diagrams.
18
borrow
DESIGN
Attribute types:
The three basic types of attributes are
Single-value attribute.
Multiplicity or multi valued attribute.
Reference to anther object, or instance connection.
Attributes represent the state of an object. Hen the state of the object changes, these
changes are reflected in the value of attributes.
UML Attribute Presentation:
The following is the attribute presentation suggested by UML.
19
Book
book id
Member
authour M name
issuing date uses mid no
returning date
+0...* a address
borrow limit
remove book()
renew book() add member()
borrow book() delete member()
return book()
+0...*
Staff Student
Title reserve
copy of tid
price
t reserved +0...*
t issued
t copies
remove()
add()
Librarian
17.Component Diagram:
student issue
register
librarian
item
22
The UML component diagrams model the dependencies between software components.
• Deployment diagrams depict the relationships between the software and hardware
system components.
• UML deployment diagrams model the physical computational nodes on which the
software will be deployed.
• They can also show the configuration or deployment of run-time elements, software
components, processes, and objects.
• Component diagrams for systems are usually combined in a single deployment
diagram
• The nodes in a system execute the code for the software components.
• 3-D boxes represent the nodes in a deployment diagram.
• Physical connections between the nodes appear in the form of connecting lines in a
deployment diagram.
Student/staff
library
database
library
manager
23
*******