Professional Documents
Culture Documents
Structural
Behavioral
Grouping
Annotational
Structural Things define the static part of the model. They represent the
physical and conceptual elements.
Visibility
Inheritance
Animal
- name : string
- id : string
- age : string
- setName()
- eat()
Tortoise Otter
This is an Inheritance relationship.
These sub – classes will inherit all the attributes and methods of the
super class. These sub – classes will use the name, id, and age that are
available in the super class.
Inheritance
Animal
- name : string
- id : int
- age : int
- weight : int
- setName()
- eat()
Tortoise Otter
Association / Multiplicity
Unary Associations
Class A Class B
Between the classes we’ve a single line with one arrow.
Class A knows about Class B.
Class B knows nothing about Class A.
Example :
Person Address
has - a
Person Address
+doSomething() +actionB()
-myB
Here, Class A has a method ‘doSomething()’ and Class B has another
method which is action().
We’re also presenting the Association with name called “myB”.
Class A Class B
-myB : Class B
+doSomething() +actionB()
Representation A
Class A Class B
+doSomething() +actionB()
-myB
We can look at both representations. Representation A has the emphasis
on the relationship between the Class A Class B.
It has that Association drawn with the arrow.
Representation B
Class A Class B
-myB : Class B
+doSomething() +actionB()
Representation B has the fact that Class A has a attribute of type Class B
written in the attribute.
Those two representations are identical.
Unary Associations and attributes are the same.
Which version should you use, depends on where your emphasis is.
If you’re going to emphasize the relationship of Class A to Class B, the
arrow is a great way to emphasize that.
Example
Person Address
-name : string -street : string
+doSomething() -city : string
-zip : string
+toString() :
-address string
Class Person has 2 attributes one is address of type Address, and the
other attribute is name which is of type string.
Both types of representations are used in the same diagram.
This is frequently done and it is perfectly fine as long as the attributes
are different. So, we don’t have any duplications.
3 types of Unary Associations
Association – Most general
Aggregation Describe whole – part relationship.
Composition Describe whole – part relationship.
Aggregation Aggregations are associations with a whole – part
relationship.
Example :
Class A Class B
The hollow diamond is next to the class that represents the whole.
Class B is part of Class A.
Example
Lake Slide
That means the construction and destruction of the part depends on the
whole.
Use Case Diagram : In this we will be dealing with systems.
Actors
Usecases
---- Relationships
Systems A system is whatever you’re developing such as website,
software component, business process, application, etc.
System is represented with rectangle.
This just visually reinforces the fact that Customer engages with
‘Banking App’ and then the Bank reacts.
The next element is the Use Case and this is where you really start to
describe what your system does.
A Use Case is depicted with Oval shape and it represents an action that
accomplishes some sort of task within the system.
They’re going to be placed within the rectangle because they’re actions
occur within the ‘Banking App’.
Our ‘Banking App’ is going to allow a Customer to log in, check their
account balance, transfer funds between accounts, and make payments
towards bills.
So, if this is what our ‘Banking App’ does, we’re going to have Use
Cases that describe each of those actions.
We’ll have a Use Case called ‘LogIn’, ‘Check Balance’, ‘Transfer
Funds’, ‘Make Payment’.
You can see that each of these Use Cases starts with a verb and
reinforces an action that takes place . we also want them to be
sufficiently descriptive.
Finally, it’s a good practice to put your Use Cases in a logical order
when possible.
That’s why we put ‘LogIn’ at the top.
That’s the first thing that will happen when a Customer uses our
‘Banking App’.
The final element in Use Case Diagrams are Relationships.
An actor, by definition is using our system to achieve a goal. So, each
actor has to interact with at least one of the Use Cases within our system.
In our example, a Customer is going to ‘LogIn’ to our ‘Banking App’.
So, we draw a solid line between the actor and the Use Case to show the
relationship.
In this example, ‘LogIn’ is the Base Use Case and ‘Verify Password’ is
the Included Use Case.
Every time a Customer logs in our ‘Banking App’ will automatically
‘Verify Password’. This ‘LogIn’ Use Case won’t be complete unless
‘Verify Password’ is complete.
Extend : An Extend relationship has a Base Use Case and an Extend Use
Case. When the Base Use Case is executed, the Extend Use Case will
happen sometimes, but not every time.
The Extend Use Case will only happen if certain criteria are met.
Another way to think of it is that you have the option to extend the
behavior of the Base Use Case.
When you have an extend relationship, you draw a dashed line with an
arrow that points towards the base use case.
In our example, LogIn is a base use case and Display Login Error is an
extended use case.
Our ‘Banking App’ won’t display login error message every time a
Customer logs in. This will only happen once in a while when the
Customer accidentally enters an incorrect password.
Generalization : Also called as Inheritance.
When you make a payment from our ‘Banking App’, you can do so from
either your ‘Checking Account’ or your ‘Savings Account.
In this scenario, ‘Make Payment’ is a general Use Case and ‘Pay from
Checking’ and ‘Pay from Savings’ are specialized Use Cases.
You could use the terms parent and children.
Each child shares the common behaviors of the parent, but each child
adds something more on its own.
To show that this is a Generalization, it is denoted as follows:
Actor
Rectangles.
So, first of all we’ll drag out an actor and place them on the left. This
represents the person trying to get money.
Then we’ll add our objects alongside it.
Lifelines are the vertical dashed lines that show the existence of an
object or actor over time.
Moving down the Lifeline means that more time is passing.
To start, think of all the steps that happen when you go to get cash at an
ATM.
The first thing, you’ll need to do when get to an ATM is insert your
card. That will be our first message.
Messages show the information between objects Sequence diagrams
show the order of interactions or sequences and they do this by moving
down the life line with each message.
Activity Diagram
One of the another important diagrams in UML is the Activity Diagram
which shows a dynamic view of the system.
The Activity Diagram is a flowchart to represent the flow of control
among the activities in a system.
Simply, it’s a operation of the system shown in the diagrammatical form
where it shows all the control flow from one operation to another.
In the Activity Diagram shows the message flow from one activity to
another.
The flow of operation can be sequential, branched or concurrent. The
activity diagram is sometimes considered as the flowchart.
Although the diagrams looks like flow chart, but they are not.
Different notations used in Activity Diagram
Start Node : The small black filled circle is the standard notation for an
initial state before an activity takes place.
In the flow chart we represent in oval shape label with the end/ stop in it,
whereas in the Activity diagram we represent with small fill circle
include borderline.
Activity : The Activity symbols are the basic building blocks of an
activity diagram and usually have a short description of the activity they
represent.
Control Flow : A solid line with an arrow represent the direction flow of
the activities. The arrow points in the direction of progressing activities.
Fork Node : A Fork splits single activity flow into 2 concurrent activities
which are represented as.
For example, an online flight reservation system. The activity starts and
needs to enter arrival and departure dates.
After that there needs to perform two activities 1. Search Availability
2. Personal Detail
Which are represented by fork symbol.
Similarly these 2 activities join together and flow another activity like
select flight which can be shown by join symbol.
Decision Symbol It is similar to the flow chart which is represented
by the diamond shape where two paths coming out of a decision and the
condition text lets you know which options are mutually exclusive.
The difference between final activity and final flow node is that the
Final Flow node denotes the end of a single control flow, whereas
activity Final node denotes the end of all control flows within the
activity.
Partition : Activity Diagram partition is also known as Swim lanes
which are used to represent or group actions carried out by different
actors in a single thread.
Denotes state
Denotes State Transition
What is a Component?
A Component can be a file, package, library, Activex component, applet,
dll, executable program and application.
If I want to make one running application, one application which will
execute in those cases, this particular component diagram can easily be
used.
In the above component diagram, we’re having one Controller, this
Controller is having view system which is interacting with the view, so
that the user can see the output of the application on their screen, which
will be containing ‘User Interface Files’.
How the user will be interacting with the Software? What will be the
interface with the help of which the user can interact?
The user interface system might be the GUI interface, so that will be
depicted in the respective component.
“Controller” which is the ‘Administrator’ of the system. These
Controllers is interacting with some set of modules.
The modules may be the “Retailer”, “Goods”, “Customer”, “Supplier”.
These modules are interacting with the database server to access
database for the read / write operations on the database.
This Controller is interacting with this Modules and these Modules are
ultimately interacting with this database server for the retrieval and
storing of information successfully and efficiently.
This is actually denoting the Software architecture of this respective
application and these Components might be localized in a single
machine, might be distributed into multiple machines and those
machines are connected by some Computer.
That’s why this Component Diagram will also depict that how these
Components are interacting and how they are interfacing with each
other.
Which Component is comprising of which Module and it will actually
depict the Software architecture.
Each and every UML diagram has their own purpose for that
application. So, Component diagram is that very UML diagram where
the System architecture, the Software system architecture, what are the
different components are requiring they are interacting with each other.
Purpose Of Component diagram
Component diagram is a special kind of diagram in UML. The purpose
is also different from all other diagrams.
It does not describe the functionality of the system but it describes the
Components used to make those functionalities.
Regarding the functionalities, Component diagram is not meant for that.
But what are the different Components that will be used to implement
those functionalities that will be described in the Component diagram.
Thus from that point of view, Component diagrams are used to visualize
the physical components in a system. These components are libraries,
packages, files, etc.
Component diagrams can also be described as a static implementation
view of a system.
Static implementation represents the organization of the components at a
particular moment.
A single Component diagram cannot represent the entire system but a
collection of diagrams is used to represent the whole.
The purpose of component diagram can be summarized as follows:
Visualize the Components of a system. Some diagrammatic notations
are there with the help of which we can visualize what are the
components we’re going to use.
Construct executables by using forward and reverse engineering.
Describe the organizations and relationships of the components.
Deployment Diagram
In Component diagram we’ve discussed what are the Components and
artifacts which will be required for the Software development and how
they will get organized and what will be the relationship between them.
But, in case of Deployment diagram we’re not bothering for the
Components, we’re bothering that how this Components will get
deployed on different physical devices and what will be the topology of
those physical devices?
What will be the hardware architecture, networking architecture on
which my Software will be running for that purpose.
Only this Deployment diagram has got its birth.
Deployment diagram are used to visualize the topology of the physical
components of a system, where the Software components are deployed.
Deployment diagrams are used to describe the Static deployment view
of a system.
Deployment diagrams consists of nodes and their relationship, respective
connections and respective ordering.
In this Deployment diagram, we will discuss about the physical
components which will be required for the smooth running of the
application.
How to draw a Deployment diagram?
Deployment diagram represents the deployment view of a system.
It is related to the Component diagram, because the Components are
deployed using the Deployment diagrams.
A Deployment diagram consists of Nodes.
Nodes are nothing but physical hardware used to deploy the application.
Why this Deployment diagram is so important?
What are the different factors which will be decided on this Deployment
diagram when having this set of some parameters.
Deployment diagrams are useful for system engineers. An efficient
Deployment diagram is very important as it controls the following
parameters:
Performance
Scalability
Maintainability
Portability
The above are the features which will be obtained and which will be
analyzed going through the Deployment diagram.
Before drawing Deployment diagram, the following artifacts should be
identified.
Nodes
Relationships among Nodes : The relative connectivity and the mode of
connectivity.
Deployment diagram shows all the nodes of the network, the
connections between them and the process that will run on each one.
Processor : A Processor in any machine that has processing power.
The servers, workstations and other machines with processors are
included in this category. The scheduling field documents the type of
process scheduling used by the Processor. They 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.
That means, a time quantum or time slice will be given to each and
every process and when this quantum will expire then the quantum will
be allocated to another process in round – robin scheduling way.
Executive : Indicates that there is some sort of computational algorithm
that controls the scheduling.
Manual : Indicates that the processes are scheduled by the user.