Uml Unit - 5
Uml Unit - 5
Action Flow
Action flows, also called edges and paths, illustrate the transitions from one action state
to another. They are usually drawn with an arrowed line.
Object Flow
Object flow refers to the creation and modification of objects by activities. An object flow
arrow from an action to an object means that the action creates or influences the object.
An object flow arrow from an object to an action indicates that the action state uses the
object.
Guards
In UML, guards are a statement written next to a decision diamond that must be true
1
UNIT-V
before moving next to the next activity. These are not essential, but are useful when a
specific answer, such as "Yes, three names are printed," is needed before moving
forward.
Synchronization
A fork node is used to split a single incoming flow into multiple concurrent flows. It is
represented as a straight, slightly thicker line.
A join node joins multiple concurrent flows back into a single outgoing flow.
A fork and join mode used together are often referred to as synchronization.
Time Event
This refers to an event that stops the flow for a time; an hourglass depicts it.
Merge Event
A merge event brings together multiple flows that are not concurrent.
2
UNIT-V
Interrupting Edge
An event, such as a cancellation, that interrupts the flow denoted with a lightning bolt.
Swim lanes
Swim lanes group related activities into one column.
In UML 1.0, components included in these diagrams were physical. In UML 2.0,
these components are less physical and more conceptual stand-alone design elements
such as a business process that provides or requires interfaces to interact with other
constructs in the system. The physical elements described in UML 1, like files and
3
UNIT-V
documents are now referred to as artifacts.
It is represented as a rectangle with a smaller rectangle in the upper right corner with
tabs.
1. Interfaces
2. Usage dependencies
3. Ports
4. Connectors
Interface
A component defines its behavior in terms of provided and required interfaces.
An interface
Is the definition of a collection of one or more abstract operations
Implementation is normally provided by a class/component
In complex systems, the physical implementation is provide by a group of classes
rather than a single class.
It may be represented using a rectangle symbol with key word <<interface>> preceding
the name.
4
UNIT-V
For displaying full signature, the interface rectangle can be expanded to show details.
It can be
Provided interface
Required interface
Provided interface
It characterizes the services that the component offers to its environment. It represented
using a circle, labeled with its name, attached by a solid line to the component.
Required interface
It characterizes the services that the component expects from its environment. It
represented using a half-circle, labeled with its name, attached by a solid line to the
component.
When two components/classes provide and require the same interface, these notations
may be combined.
Dependencies
Components can be connected by usage dependencies. A usage dependency is a
relationship which one element requires another element for its full implementation. It is
represented using a dashed arrow with a <<use>> keyword
5
UNIT-V
Ports
A port specifies an interaction point through which a component can communicate with
its environment, with other components, or with its internal parts. Ports are represented
using a square along the edge of the system or a component. A port is often used to
help expose required and provided interfaces of a component.
Deployment Diagram
It shows the assignment of concrete software artifacts to computational nodes. It shows
the deployment of software elements to physical architecture and communication
between elements.
6
UNIT-V
that runs with in device node. For example:
a. An operating system (OS) is software that hosts and executes programs.
b. A virtual machine hosts and executes programs.
c. A database engine receives SQL program requests and executes them,
and hosts/executes internal stored procedures.
d. A web browser hosts and executes JavaScript, applets, flash and other
executable technologies.
e. A servlet or EJB container
Fig. Gigabit Ethernet as communication path between application and database servers.
When deployment targets are execution environments, communication path will typically
represent some protocol.
TCP/IP protocol as communication path between J2EE server and database system.
Deployment
A deployment is a dependency relationship which describes allocation (deployment) of
an artifact to a deployment target. Deployment could be shown as a dependency that is
drawn from the artifact (supplier) to the deployment target (client) and is labeled with
«deploy».
7
UNIT-V
J2EE web application archive portfolio.war deployed on Apache Tomcat Server.
Definitions
Event: An event is a significant or noteworthy occurrence. For example: A telephone
receiver is taken off the hook.
Composite State
Composite state is defined as state that has sub states (nested states). Sub states could
be sequential (disjoint) or concurrent (orthogonal). UML 2.4 defines composite state as
the state which contains one or more regions..
Submachine State
A submachine state specifies the insertion of the specification of a submachine state
machine. The state machine that contains the submachine state is called the containing
state machine. The same state machine may be a submachine more than once in the
context of a single containing state machine.
Transition: A transition is a relationship between two states that indicates that when an
event occurs, the object moves from the prior state to the subsequent state. Transitions
are shown as arrows, labeled with their event. For example: When the event "off hook"
occurs, transition the telephone from the "idle" to "active" state.
Final State
Final state is a special kind of state signifying that the enclosing region is completed.
A final state is shown as a circle surrounding a small solid filled circle.
The below figure represents the state machine diagram for Telephone
9
UNIT-V
State-Independent Objects
If an object always responds the same way to an event, then it is considered state-
independent (or modeless) with respect to that event. For example, if an object receives
a message, and the responding method always does the samething—the method will
typically have no conditional logic.
State-Dependent Objects
State-dependent objects react differently to events depending on their state. For
example, a telephone is a very state-dependent object. The phone’s reaction to pushing
a particular button depends on the current mode of the phone – offhook, engaged, , in a
configuration subsystem and so on.
The following list of common objects which are often state-dependent and which may be
useful to create state machine diagram.
10
UNIT-V
Role Mutators These are objects that change their role. Each role is
represented by a state.
o A Person changing roles from being a student to employee.
Object Diagram
An object diagram shows a set of objects and their relationships at a point in time. It may
be considered a special case of a class diagram.
Uses
1. It shows a snapshot of the detailed state of a system at a point in time.
2. They are used test accuracy of class diagram.
3. They examine specific iteration of a general system.
4. They are used to represent executable system.
11
UNIT-V
Every object is actually symbolized like a rectangle, that offers the name from the
object and its class underlined as well as divided with a colon.
Object Attributes
Similar to classes, list object attributes inside a separate compartment. However,
unlike classes, object attributes should have values assigned for them.
Links
Links are for connecting different objects. Here we can use all the relationships used in
class diagram like association, composition, generalization, aggregation, etc.
12
UNIT - V
A concrete use case is initiated by an actor and performs the entire behavior desired by
the actor.These are the elementary business process use cases. For example, Process
Sale is a concrete use case.
An abstract use case is never instantiated by itself; it is a sub-function use case that is
part of another use case. HandlePayment is abstract; it is always part of Process Sale
use case.
A use case that includes another use case, or that is extended or specialized by another
use case is called a base use case. Process Sale is a base use case with respect to the
included HandlePayment sub-function use case.
Points to remember:
1. Only binary associations are allowed between actors and use cases.
2. An actor must be associated with at least one use case.
3. An actor can be associated with multiple use cases.
4. Multiple actors can be associated with a single use case.
UNIT - V
Example
If there are several actors associated to the same use case, it may not be obvious from
use case diagram which actor initiates the use case, i.e. is a "primary actor". (In non-
standard UML, primary actors are those using system services, and supporting
actors are actors providing services to the system).
2. Generalization of an actor
A generalization is a binarydirected relationship between a more generalthing(super
class)and a more specific kind of that thing (subclass).
Generalization of an actor means that one actor can inherit the role of the other actor.
The descendant inherits all the use cases of the ancestor. The descendant has one or
more use cases that are specific to that role.
Generalization between actors is rendered as a solid directed line with a large hollow
triangle arrowhead.
For Example
Generalization is shown as a solid directed line with a large hollow triangle arrowhead,
UNIT - V
the same as for generalization between actors, directed from the more specific use case
to the general use case.
Case 1: Example
A large use case could have some behaviors which might be detached into distinct
smaller use cases to be included back into the base use case using the UML include
relationship.
Fig. Use cases B and C are extracted from larger use case A into separate use cases.
For example, Checkout use case includes several use cases - Scan Item, Calculate
Total and Tax, and Payment
UNIT - V
Case2: Example
When two or more use cases have some common behavior, this common part could be
extracted into a separate use case to be included back by the use cases with the
UML include relationship.
Fig. Use case C is extracted from use cases A and B to be reused by both use cases
For example, DepositFunds and WithdrawCash use cases include Update Balance
use case.
Here are few things to consider when using the <<extend>> relationship.
1. The extending use case is dependent on the extended (base) use case.
2. The extending use case is usually optional and can be triggered conditionally.
3. The extended (base) use case must be meaningful on its own.
Example:
UNIT - V
1. In the above diagram the “Calculate Bonus” use case doesn’t make much sense
without the “Deposit Funds” use case.
2. In the diagram, you can see that the extending use case is triggered only for
deposits over 10,000 or when the age is over 55.
3. This means it should be independent and must not rely on the behavior of the
extending use case.
Identifying a super class and subclasses is of value in a domain model because their
presence allows us to understand concepts in more general, refined and abstract terms.
It leads toeconomy of expression, improved comprehension and a reduction in repeated
information.
In UML, the generalization relationship between elements is shown as a solid line with a
large hollow triangle arrowhead pointing to the more general element from the more
specialized one. Either a separate-target or shared-target arrow style may be used.
Generalization relationships that reference the same general classifier can also be
connected together in the "shared-target style."
For example, consider the superclass Payment and its subclasses (CashPayment,
CreditPayment, and CheckPayment).Assume the definition of Payment is that it
represents the transaction of transferring money for a purchase from one party to
another, and that all payments have an amount of money transferred. The model
UNIT - V
Definition: All members of a conceptual subclass set are members of their super class
set.
For example, in terms of set membership, all instances of the set Credit Payment are
alsomembers of the set Payment. In a Venn diagram, this is shown as:
For example, below figure states that all Payments have an amount and are associated
with a Sale. All Payment subclasses also have an amount and paying for a Sale. This rule
of conformance to a super class definition is the 100% Rule.
For example: In POS, men and women pay different amounts based different criteria,
e.g. have specific gender and age discounts. It is only useful for POS
But useful?
Male Female
Customer Customer
For example, assume that every Payment instance must more specifically be an
instance of the subclass CreditPayment, CashPayment, or CheckPayment. This is
illustrated in the below Venn diagram. Since every Payment member is also a member
of a subclass, Payment is anabstract conceptual class by definition.
UNIT - V
Association Classes
In a domain model, if a class C can simultaneously have multiple values for the same
kind of attribute A, then place attribute A in another class that is associated with C.
A role name identifies an end of an association and describes the role played by objects
in the association. Below figure shows role name example:
It usually starts with a lowercase letter. If not explicitly present, assume that the default
role name is equal to the related class name, though starting with a lowercase letter.
For example, the role of cashier and manager may be expressed in at least the two
ways illustrated in Figure.
Roles in associations are interesting because they are a relatively accurate way to
express the notion that the same instance of a person takes on multiple (and
dynamically changing) roles in various associations.
Reflexive Associations
A concept may have an association to itself; this is known as a reflexive association.
Qualified Associations
A qualifier may be used in an association; it distinguishes the set of objects at the far
end of the association based on the qualifier value. An association with a qualifier is a
qualified association.
Derived Elements
A derived element can be determined from others. Attributes and associations are the
most common derived elements. In the UML, it is shown with a "/" preceding the element
name.
For example, a Sale total can be derived from SalesLineItem and ProductDescriptions
information.
Aggregation
Aggregation is a special form of association that models a whole-part relationship
between an aggregate (the whole) and its parts. This kind of relationship is called
aggregation.
It is a "weak" form of aggregation when part instance is independent of the whole. Whole
is usually referred to as composite.
It is represented using solid line with hollow diamond symbol pointing to the whole part.
It is binary association,
It is asymmetric - only one end of association can be an aggregation.
It is transitive - aggregation links should form a directed, acyclic graph, so that no
composite instance could be indirect part of itself,
The small part can exist independently of the composite.
Example:
Composition
Composite aggregation (composition) is a "strong" form of aggregation with the
following characteristics:
It is binary association,
It is a whole/part relationship,
A part could be included in at most one composite (whole) at a time, and
If a composite (whole) is deleted, all of its composite parts are "normally" deleted
with it.
It is represented using solid line with filled diamond symbol pointing to the whole
part.
UNIT - V
Example:
A class shown in a foreign package may be modified with new associations, but must
otherwise remain unchanged.
Package Dependencies
A package dependency indicates that elements of the dependent package in some way
know about or are coupled to elements in the target package such the dependency may
be shown with a dependency relationship, depicted with an arrowed line.
It is useful if all elements related to the domain model are rooted in a package called
Domain, and all widely shared, common, core concepts are defined in a packaged
named something like Core Elements or Common Concepts, in the absence of any other
meaningful package within which to place them.