You are on page 1of 25

Software Design and Architecture

Engr Saiqa Anjum


Lecturer SE
Software Design and Architecture

Unified Modeling Language


Lecture 3
Software Design and Architecture
UNIFIED MODELING LANGUAGE (UML) OUTLINE

 Use Cases
 Class Diagram
 Component Diagrams
 Interaction Sequence Diagrams
 Activity Diagrams
 State Machine Diagrams
 Object Constraint Language
 Deployment Diagrams
 Design Patterns or GRASP Patterns
Software Design and Architecture
UNIFIED MODELING LANGUAGE (UML)

 UML is a visual language that can be used in developing


software systems.
 UML is a specification language and has a set of rules
that determine how it can be used.
 Most of the elements of UML are graphical and they
consist of lines, rectangles, ovals and other shapes.
 The UML elements are defined in the specifications.
Some of the UML elements are class, attribute and
operations.
Software Design and Architecture
UML CLASS DIAGRAM

 The basic building block for class diagrams is the class.


 Classes are shown as rectangle with the name of the
class centered in the rectangle.
 The class name should start with a capital letter.
 A class name should have no spaces between multiple
words in the name, but should start each subsequent
word with a capital letter.
 A class may include list compartments for attributes,
operations and more predefined compartments for other
features
Software Design and Architecture
UML CLASS DIAGRAM

 The list compartments for attributes and operations


can be independently omitted.
 In other words it would be acceptable to show a class
as:
A class name only.
 A class name and a list of attributes.
 A class name and a list of operations.
 A class name and a list of attributes and operations
Software Design and Architecture
UML CLASS DIAGRAM
Software Design and Architecture
UML CLASS DIAGRAM EXAMPLE
Video Rental System
Software Design and Architecture
UML CLASS DIAGRAM
VISIBILITY OF ATTRIBUTES AND OPERATIONS
 It shows the level of required information hiding that
must be enforces.

Visibility Symbol Accessibility


Public + All objects can access within system.
Private - Instances of the implementing class.
Protected # Instances of the implementing class
and its sub-classes.
Software Design and Architecture
UML CLASS DIAGRAM
CLASS RELATIONSHIPS
 It is representation of the connections among different
classes or a class with itself. There are three main
categories of the class relationships.

 Association Relationships
 Generalization Relationships
 Aggregation Relationships
Software Design and Architecture
UML CLASS DIAGRAM
ASSOCIATION RELATIONSHIPS
 It is a bidirectional semantic connection between
classes.
 The types of association relationship are:

 Name of relationship
 Role of class being played in the relationship
Software Design and Architecture
UML CLASS DIAGRAM
ASSOCIATION RELATIONSHIPS
 The name of relationship type is shown by :

 drawing line between classes


 labeling with the name of the relationship
 indicating with a small solid triangle beside the name
of the relationship the direction of the association
Software Design and Architecture
UML CLASS DIAGRAM
ASSOCIATION RELATIONSHIPS
 The role type is shown by :

 drawing line between classes


 indicating with a plus sign before the role name
Software Design and Architecture
UML CLASS DIAGRAM
GENERALIZATION RELATIONSHIPS
 Enables the analyst to create classes that inherit attributes
and operations of other classes
 Represented by a-kind-of relationship
Software Design and Architecture
UML CLASS DIAGRAM
GENERALIZATION RELATIONSHIPS
 Arrow head must be towards the superclass or parent
class from which the sub-class or parent class is going to
inherit the attributes.
Software Design and Architecture
UML CLASS DIAGRAM
GENERALIZATION RELATIONSHIPS
Software Design and Architecture
UML CLASS DIAGRAM
GENERALIZATION RELATIONSHIPS
Software Design and Architecture
UML CLASS DIAGRAM
AGGREGATION RELATIONSHIPS
 The aggregation relationship is denoted by placing a
diamond nearest the class representing the aggregation.
 It refers to the formation of a particular class as a result of
one class being aggregated or built as a collection. For
example, the class “library” is made up of one or more
books, among other materials.
Software Design and Architecture
UML CLASS DIAGRAM
MULTIPLICITY
 Multiplicity documents how many instances of a class can
be associated with one instance of another class
Software Design and Architecture
UML CLASS DIAGRAM
MULTIPLICITY
Denotes the minimum number.. maximum number of
instances

Exactly one 1
Zero or more 0..* or 0..m
One or more 1..* or 1..m
Zero or one 0..1
Specified range 2..4
Multiple, disjoint ranges 1..3,
Software Design and Architecture
UML CLASS DIAGRAM
DERIVING THE CLASSES
 There are two main approaches to derive the class
diagrams:
 from use cases and their scenarios
 from Class Responsibility Collaborators (CRC) model
and that one is a collection of standard indexed cards.
 To analyze the text in the use-case descriptions and
scenarios and find out the key class concepts
Software Design and Architecture
CASCADING STYLE SHEETS (CSS)
Software Design and Architecture
References

Multiple sources.

Acknowledgement
Special thanks to all of the computer scientists,
engineers, book authors and others for providing such
a useful information.
HAVE A NICE DAY

Q/A
ARMY PUBLIC CLLEGE OF MANAGEMENT & SCIENCES, UET TAXILA

You might also like