0% found this document useful (0 votes)
8 views33 pages

Software Engg Week 10 Class-component-Deployement

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

Software Engg Week 10 Class-component-Deployement

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

UML + Class Diagram

Lecture
What is UML?

The Unified Modelling Language is a standard graphical


language for modelling object oriented software
 UML stands for Unified Modeling Language.
 UML is different from the other common programming
languages such as C++, Java, COBOL, etc.
 UML is a pictorial language used to make software
blueprints.
 UML can be described as a general purpose visual
modeling language to visualize, construct and
document software system.
UML diagrams
– Class diagrams
■ describe classes and their relationships

– Interaction diagrams /Sequence diagram


■ show the behaviour of systems in terms of how
objects interact with each other

– Activity diagrams
■ show how systems behave internally

– Component and deployment diagrams


■ show how the various components of systems are
arranged logically and physically
01. CLASS DIAGRAM
Class

■ Class is an entity which have


– Data
– Behavior
■ Example Student
– Data : roll no, Name, Mobile No, GPA
– Behavior: add course, drop course, withdraw course

■ All objects that exhibit same data and behavior can be formed into a
class.
■ Class are usually nouns in requirement document.
Main components of class

■ Class
■ Attributes
■ Operations
What is Class Diagram

■ A class diagram is a UML diagram type that describes a system by


visualizing the different types of classes within a system and the kinds
of static relationships that exist among them.
■ It illustrates
– the operations and attributes of the classes.
– Relationship between the classes
Class Diagram Relationships
1. Associations
 An association relation is established when two classes are connected to
each other in any way.
 For example:
 A bank registers account.
 An association is used to show how two classes are related to each other
Multiplicity
 An example of this kind of association is many accounts being registered by
the bank. Hence, the relationship shows a star sign near the account class
(one to many and many to many etc).
 Symbols indicating multiplicity are shown at each end of the association

 Each association can be labelled, to make explicit the nature of the


association
Reflexive Associations
– It is possible for an association to connect a class
to itself
2. Generalization
 Generalization is known as an “is a” relationship
 the child class is a type of the parent class
 Generalization is the ideal type of relationship that is used to showcase reusable
elements in the class diagram.
 The child classes “inherit” the common functionality defined in the parent class.
3. Aggregation
 It is also called a “has a” relationship.
 Aggregations are special associations that represent ‘part-of’ relationships.
 While if A and B are associated with each other, such that B can exist
without being associated with A, then this association in known as
Aggregation.
4. Composition
 The composition is a variation of the aggregation relationship.
 A composition is a strong kind of aggregation
 if the aggregate is destroyed, then the parts are destroyed as well
 If A and B two classes are related to each other such that, B ceased to
exist, when A is destroyed, then the association between two objects
is known as Composition. An example is Building and room.
How to draw class diagram
Step 1: Identify the class names
Step 2: Identify the attributes and operations of the class
Step 3: Distinguish relationships
Next step is to determine how each of the classes or objects are related to one
anotherStep
Step 4: Create the Structure
First, add the class names and link them with the appropriate connectors. You
can add attributes and functions/ methods/ operations later.
Points to Remember
– The name of the class diagram should be meaningful to describe the
aspect of the system.
– Each element and their relationships should be identified in advance.
– Responsibility (attributes and methods) of each class should be clearly
identified
– Use notes whenever required to describe some aspect of the diagram.
– At the end of the drawing it should be understandable to the
developer/coder.
– Finally, before making the final version, the diagram should be drawn
on plain paper and reworked as many times as possible to make it
correct.
Component Diagram
LECTURE
Component diagram
Component diagrams are used to visualize the organization of system components and the
dependency relationships between them.
They provide a high-level view of the components within a system.
The components can be a software component such as a database or user interface; or a hardware
component such as a circuit, microchip or device; or a business unit such as supplier, payroll or
shipping.
Symbol of Component
There are two commonly used symbols for component:
Rectangle with the component stereotype (the text <<component>>). The component stereotype
is usually used above the component name to avoid confusing the shape with a class icon. (Fig1)
Rectangle with the component icon in the top right corner and the name of the component. (Fig 2)

Fig 1 Fig 2
Provided and Required
Interface
Interfaces in component diagrams show how components are wired together and interact with each
other.
Required interface is represented with a semi-circle and a solid line.
Provided interface is represented with a circle and solid line.
This shows that one component is providing the service that the other is requiring.
PORT DEPENDENCIES

Port is represented by the small square at the you can just as well use a dependency arrow to
end of a required interface or provided show the relationship between two
interface components. If you don’t want to use ball and
socket join
It is used when the component delegates the
interfaces to an internal class
How to draw
Step 1: figure out the purpose of the diagram and identify the artifacts such as the files, documents
etc. in your system or application that you need to represent in your diagram.
Step 2: As you figure out the relationships between the elements you identified earlier, create a
mental layout of your component diagram
Step 3: As you draw the diagram, add components first, grouping them within other components
as you see fit
Step 4: Next step is to add other elements such as interfaces, classes, objects, dependencies etc. to
your component diagram and complete it.
Step 5: You can attach notes on different parts of your component diagram to clarify certain details
to others
Component Diagram of
ATM system
Component Diagram of
Online Shopping
Deployment
Diagram
Deployment Diagram
A deployment diagram is a UML diagram type that shows the execution architecture of a system,
including nodes such as hardware or software execution environments, and the middleware
connecting them.
Deployment diagrams are typically used to visualize the physical hardware and software of a
system.
Using it you can understand how the system will be physically deployed on the hardware.
Components of Deployment
Diagram
Node: Artifacts:
A node, is a physical entity that executes Artifacts are concrete elements that are caused
one or more components, subsystems or by a development process.
executables.
Examples of artifacts are libraries, archives,
A node could be a hardware or software configuration files, executable files etc.
element.
Components of Deployment
Diagram
Device: Communication Association
A device is a node that is used to represent a This is represented by a solid line between two
physical computational resource in a system. An nodes. It shows the path of communication
example of a device is an application server. between nodes.
How to draw Deployment
Diagram
Step 1: Identify the nodes and devices within the system you’ll be visualizing with the diagram.
Step 2: Figure out the relationships between the nodes and devices. Once you know how they are
connected, proceed to add the communication associations to the diagram.
Step 3: Identify what other elements like components, active objects you need to add to complete
the diagram.
Step 4: Add dependencies between components and objects as required.
Deployment Diagram of
ATM

You might also like