0% found this document useful (0 votes)
36 views13 pages

Uml Class Diagram

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 13

August 22, 2015 | 3:28:23 PM

1. UML CLASS DIAGRAM:


:
It shows the static structure of the model

It is type of UML-STATIC DIAGRAM

It is a collection of static modeling elements like classes and their


relationships, connected as a graph tp each other and to their contents

Class diagrams does not show temporal information, which is required in


dynamic modeling

A class diagram is drawn as a rectangle with three components, separated


by horizontal lines.
SYMBOLS:
1. Class

Set of attributes and operations

It has three components


Symbol

2. Interface

Set of operations only

Has two components

1
August 22, 2015 | 3:28:23 PM

Symbol

3. Association
4. Multiplicity
0 exactly zero
1 exactly one
1..* one or more
0..* zero or more
n many
5. Generalization

It creates an inheritance relationship

It has is-a relationship


Symbol

6. Aggregation
7. Composition

2
August 22, 2015 | 3:28:23 PM

THREE VIEWS OF CLASS IN CLASS DIAGRAM


:
:1. CONCEPT VIEW

It identify the software class in application

It is noun (Object Oriented Analysis =OOA)

Has only class name no attributes and operations

It is optional
Ex:

Student

2. SOFTWARE VIEW

It is nothing but OOA with details (OOD)

It is optional
Ex:

Student
+name
+id

+study()
+play()

3. IMPLEMENTATION VIEW

Programming types with specification views

It is optional

3
August 22, 2015 | 3:28:23 PM

Ex:

Student
+name: String
+id: int

+study():int
+play():void

GENERALIZATION

It creates an inheritance relationships

It has is-a relationship

Symbol:

I. GENERALIZATION EXAMPLES
:
Ex: 1 :

4
August 22, 2015 | 3:28:23 PM

NOTE:

Here C is a super class and C++, Java and C#.NET is a sub classes of super
class

All sub classes (C++, Java and C#.NET) are derived from a single class
called C
Ex: 2

NOTE:

Here C is a super class and Bike, Car and Bus is a sub classes of super class

All sub classes (Bike, Car and Bus) are derived from a single class called
Vehicle

II. AGGREGATION EXAMPLES


Ex: 3 :
:

5
August 22, 2015 | 3:28:23 PM

III. COMPOSITION EXAMPLES

:
Ex:4 [COMPOSITION]
:

NOTE:
If Folder(Container Object) is detroyed then Files (contained object) will
be deleted

Because composition has a strong-life-dependancy.


Ex:5 [COMPOSITION]

6
August 22, 2015 | 3:28:23 PM

NOTE:

If Book(Container Object) is detroyed then Pages(contained object) will be


deleted

Because composition has a strong-life-dependancy.


Ex:6 [COMPOSITION]

NOTE:

If Os(Container Object) is detroyed then Softwares(contained object) will


be deleted

Because composition has a strong-life-dependancy.


Ex: 7 [COMPOSITION]

NOTE:

If Mobile(Container Object) is detroyed then Camera, Browser and


Applications(contained object) will be deleted

Because composition has a strong-life-dependancy.


7
August 22, 2015 | 3:28:23 PM

AGGREGATION vs COMPOSITION
:
:
Ex: 1 [AGGREGATION vs COMPOSITION]

NOTE:
COMPOSITION
If the Mobile(Container Object) is destroyed/deleted, then its
contents(Contained Object: Message, Camera, Softwares) will be
destroyed beacause of strong-life cycle dependancy
AGGREGATION
If the Mobile(Container Object) is destroyed/deleted, then its
contents(Contained Object: Battery, Simcard, Memorycard) will
not be destroyed

8
August 22, 2015 | 3:28:23 PM

Ex:2 [AGGREGATION vs COMPOSITION]

NOTE:
COMPOSITION

If the Desktop Computers (Container Object) is destroyed/deleted,


then its contents (Contained Object: OS, Softwares, Backup) will be
destroyed beacause of strong-life cycle dependancy
AGGREGATION
If the Desktop Computers (Container Object) is destroyed/deleted,
then its contents(Contained Object: OS, Softwares, Backup) will not
be destroyed

9
August 22, 2015 | 3:28:23 PM

I. UML CLASS DIAGRAM EXAMPLES


:
:
1. IT DEPARTMENT:
:
:
:
:
:

:
:
:
:
:
:
:
:

10
August 22, 2015 | 3:28:23 PM

2. SEARCH ENGINE:
:
:
:
:

:
:
:
:
:
:
:
:

11
August 22, 2015 | 3:28:23 PM

3. LIBRARY MANAGEMENT SYSTEM:


:
:
:

:
:
:
:
:
:
:
:

12
August 22, 2015 | 3:28:23 PM

4. HOSPITAL MANAGEMENT SYSTEM:


:
:
:

:
:
:
:
:
:
:
:

13

You might also like