UML Class Note
UML Class Note
UML Class Note
The Unified Modeling Language (UML) is a standard language for specifying, visualizing,
constructing, and documenting the artifacts of software systems, as well as for business modeling and
other non-software systems.
A brief description describes what that use case will do. E.g. Transfer Funds use case will allow a
customer or bank employee to move funds from one checking or savings account to another checking or
savings account.
The preconditions for a use case list any conditions that have to be met before the use case can
start at all. Precondition may be termination of another use case.
The flow of event describes step-by-step what will happen to execute the functionality in the use
case. The primary and alternate flow of events includes:
How the use case starts
The various paths through the use case
The normal, or primary, flow through the use case
Any derivations from the primary flow, known as alternate flow, through the use case
Any error flows
How the use case ends
According to the ATM transaction example primary and alternate flows are
Primary flow
1. The use case begins when the bank customer inserts their card into the ATM.
2. The ATM presents a welcome message and prompts the user to enter their personal identification
number (PIN).
3. The bank customer enters their PIN.
4. The ATM confirms that the PIN is valid. If the PIN is not valid, alternate flow A1 is performed.
5. The ATM presents the options available:
Deposit funds
Withdraw cash
Transfer funds
6. The use selects the withdraw Cash option.
7. The ATM prompts for the amount to be withdrawn.
8. The user enters the amount to be withdrawn.
9. The ATM determines whether the amount has sufficient funds. If there are insufficient funds,
Alternate Flow A2 is performed. If there is an error in attempting to verify funds, Error Flow E1
is performed.
10. The ATM deducts the withdrawal amount from the Customer’s account.
11. The ATM provides the customer with the requested cash.
12. The ATM prints a receipt for the customer.
13. The ATM ejects the customer’s card.
14. The use case ends.
An abstract actor is an actor that has no instances i.e. the actor’s cardinality is exactly zero.
A concrete actor is an actor, which will be directly instantiated. The individual and corporate actors are
concrete actors.
Sequence diagram:
1. The process begins when Joe insert his card into the card reader.
2. The card reader reads the number on Joe’s card.
3. Then tells the ATM screen to initialize itself.
4. The ATM prompts Joe for his PIN.
5. Joe enters his PIN (1234).
6. The ATM opens his account.
7. Joe’s PIN is validated.
8. ATM prompts him for a transaction.
9. Joe selects withdraw.
10. The ATM prompts Joe for the withdrawal amount.
11 & 12. Joe enters $20.
13. The ATM verifies that the Joe’s account has sufficient funds.
14. And subtract $20 from the account.
15 & 16. The ATM dispenses $20 and ejects Joe’ card.
Each object has a life line, drawn as a vertical dashed line below the object. A message is drawn
between the lifelines of two objects to show that the objects communicate.
Balking: With this option, the client sends the message to the supplier. If the supplier is not immediately
ready to accept the message, the client abandons the message.
Timeout: With this option, the client sends the message to the supplier, and waits a specified amount of
time. If the supplier isn’t ready to receive the message in that time, the client abandons the message.
Asynchronous: With this option, the client sends the message to the supplier. The client then continues
processing, with out waiting to see if the message was received or not.
In the above sequence diagram condition script has been used
Collaboration Diagrams
Press F5 (or Browse Go to collaboration diagram) to get the collaboration diagram from sequence
diagram. Then to return to sequence diagram again press F5 (or Browse Go to sequence diagram).
Class Diagram
A class is something that encapsulates information and behavior. The top section of the class holds the
class name and, optionally, its stereotype. The middle section holds the attributes or the information that
a class holds. The lower section holds the operations or the behavior of a class. We can also show the
visibility of each attribute and operation, data type of each attribute, and the signature of each operation
on these diagrams.
Component: The component icon is used to represent a software module with a well-defined interface.
The type of component may be ActiveX, Applet, Application, DLL and executables etc.
Subprogram specification and body: These icons are used to represent a subprogram’s visible
specification and the implementation body. A subprogram is typically a collection of subroutines.
Subprograms do not contain class definitions.
Main program: A main program is the file that contains the root of a program.
Package specification and body: A package is the implementation of a class. A package specification
is a header file, which contains function prototype information for the class.
There are additional Component icons that are used for run time components. Runtime component
include executable files, DLL files and tasks.
DLL file: This icon is used to represent data link library (DLL) file.
Task specification and body: These icons are used to represent package that have independent threads
of control. An executable file is commonly represented as a task specification with a .EXE extension.
Deployment diagram
Deployment diagram shows all of the nodes of the network, the connections between them, and the
process that will run on each one.
Processor: A processor is any machine that has processing power. The servers, workstations ans other
machines with processors are included in this category. The scheduling field documents the type of
process scheduling used by the processor. The options are
Preemptive: Indicates that the high priority processes can preempt low priority processes.
Non Preemptive: Indicates that the processes have no priority. The current process executes
until it is finished, at which time the next process begins.
Cyclic: Indicates that the control cycles between the processes; each process is given set amount
of time to execute, then control passes to the next process.
Executive: Indicates that there is some sort of computational algorithm that controls the
scheduling.
Manual: Indicates that the processes are scheduled by the user.
Device: A device is a machine or piece of hardware without processing power. Devices include item
such a dumb terminals, printers or scanners.
Connection: A connection represents some type of hardware coupling between two entities. An entity is
either a processor or a device. The hardware coupling can be direct, such as an RS232 cable, or indirect,
such as satellite-to-ground communication. Connections are usually bi-directional.
1. Class Diagram – The most widely use UML diagram is the class diagram. It
is the building block of all object oriented software systems. We use class
diagrams to depict the static structure of a system by showing system’s
classes, their methods, and attributes. Class diagrams also help us identify
relationship between different classes or objects.
2. Composite Structure Diagram – We use composite structure diagrams to
represent the internal structure of a class and its interaction points with other
parts of the system. A composite structure diagram represents relationship
between parts and their configuration which determine how the classifier
(class, a component, or a deployment node) behaves. They represent
internal structure of a structured classifier making the use of parts, ports, and
connectors. We can also model collaborations using composite structure
diagrams. They are like class diagrams except they represent individual
parts in detail as compared to the entire class.
3. Object Diagram – An Object Diagram can be referred to as a screenshot of
the instances in a system and the relationship that exists between them.
Since object diagrams depict behavior when objects have been instantiated,
we are able to study the behavior of the system at a particular instant. An
object diagram is like a class diagram except it shows the instances of
classes in the system. We depict actual classifiers and their relationships
making the use of class diagrams. On the other hand, an Object Diagram
represents specific instances of classes and relationships between them at a
point of time.
4. Component Diagram – Component diagrams are used to represent the how
the physical components in a system have been organized. We use them for
modelling implementation details. Component Diagrams depict the structural
relationship between software system elements and help us in
understanding if functional requirements have been covered by planned
development. Component Diagrams become essential to use when we
design and build complex systems. Interfaces are used by components of
the system to communicate with each other.
5. Deployment Diagram – Deployment Diagrams are used to represent
system hardware and its software. It tells us what hardware components
exist and what software components run on them. We illustrate system
architecture as distribution of software artifacts over distributed targets. An
artifact is the information that is generated by system software. They are
primarily used when a software is being used, distributed, or deployed over
multiple machines with different configurations.
6. Package Diagram – We use Package Diagrams to depict how packages
and their elements have been organized. A package diagram simply shows
us the dependencies between different packages and internal composition of
packages. Packages help us to organize UML diagrams into meaningful
groups and make the diagram easy to understand. They are primarily used
to organize class and use case diagrams.
Behavior Diagrams –