You are on page 1of 20

Unit 7 – Software Engineering

7.8 Object Oriented Design with UML

1
Object Oriented Design with UML

 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.

 The UML is a very important part of developing object-oriented software


and the software development process.

 The UML uses mostly graphical notations to express the design of


software projects.

2
What is Use Case Diagrams

 Use case diagrams are closely connected to scenarios.

 Use case diagrams helps to visualize system functions from a


user perspective.

 It is a typical interaction between the user and the system.

3
Use Case, Actor and Communications

 Actors are stick figures. An actor is who or what


initiates the events involved in that task. Actors are simply
roles that people or objects play.

 Use cases are ovals. A use case is a summary of


scenarios for a single task or goal. It shows what the
system does and how the system does.

 Communications are lines that link actors to use


cases.

 A use case diagram is a collection of actors, use cases, and their communications.

4
Use Case Diagram
Doctor Channeling System

5
Use Case Diagram for ATM System

6
Use Case Diagram for a Library

User
Librarian

7
Use Case Diagram for eBay

8
Use Case Diagram for a Hotel

9
Class Diagrams

Class diagrams are widely used to describe the types of objects in a


system and its relationships. It is a static model which shows,
1. Classes, their attributes and methods

2. Class Hierarchies

3. Class Associations

4. Class Aggregations

5. Class Composition

6. Class Generalization

10
Classes, their attributes and operations

Account Class Name

Account No.
Date Opened Data/ Attributes
Balance
Deposit ()
Withdraw () Methods/ Operations
Check Balance

11
Hierarchy Relationship of Class
Diagram

Product
Product No.
This shows a “is a kind of” relationships
Description
inheritance.
Price
Set Price ()
Show Details ()

Hard Disk Monitor


Capacity Type
Speed Size
Price Price
Show Details () Show Details ()

12
Association Relationship of a Class
Diagram
 An association is are relationship between classes. It includes cardinality/multiplicity constrains.

 It is a symmetrical (Balanced) relationship between 2 classes, which specifies the manner (way) in
which, objects belong to the 2 classes are related.

13
Aggregation Relationship of a Class
Diagram
 Aggregation implies relationships where the child can exist independently of the
parent.
 Aggregation is more specific than association.

14
Composition Relationship of a
Class Diagram
 Composition is a stronger variant of the "has a" association relationship.

 Composition implies relationships where the child can not exit independent of the
parent.

 Composition is more specific than aggregation

15
Generalization Relationship of a
Class Diagram
A generalization is used when two classes are similar, but have some differences. Following example
the classes Corporate Customer and Personal Customer have some similarities such as name and
address, but each class has some of its own attributes and operations.

16
17
Class Diagram - Order Processing
System

18
Class Diagram – Online Shopping
System

19
Lesson Summary

 Unified Modelling Language – UML


 Use Cases, Actors, and Communications
 Use Case Diagrams – Bank, eBay, Library
 Attributes and Methods in Classes
 Inheritance
 Association / Aggregation / Composition
 Class Diagrams Examples

20

You might also like