Professional Documents
Culture Documents
Advanced Programming With Java and Uml: by Dr. Salamudeen Alhassan
Advanced Programming With Java and Uml: by Dr. Salamudeen Alhassan
AND UML
CSC 417
By
Dr. Salamudeen Alhassan
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 2 / 19
Class Diagram
It is a static diagram.
It represents the static view of an application.
It is used for visualizing, describing, and documenting different
aspects of a system as well as for constructing executable code
of the software application..
It describes the attributes and operations of a class and also the
constraints imposed on the system.
it is widely used in the modeling of object oriented systems.
It shows a collection of classes, interfaces, associations,
collaborations, and constraints.
It is also known as a structural diagram.
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 3 / 19
Class Diagram cont.
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 4 / 19
Class Diagram cont.
How to Draw a Class Diagram?
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
For each class, minimum number of properties should be
specified, as unnecessary properties will make the diagram
complicated.
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.
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 5 / 19
Class Diagram cont.
How to Draw a Class Diagram?
Class name
The name of the class appears in the first partition.
Class Attributes
Attributes are shown in the second partition.
The attribute type is shown after the colon.
Class Operations (Methods)
Operations are shown in the third partition.
The return type of a method is shown after the colon at the end
of the method signature.
The return type of method parameters are shown after the
colon following the parameter name.
Class Visibility
Visibility of attributes and operations are denoted by the +, -
and # symbols.
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 6 / 19
Class Diagram cont.
How to Draw a Class Diagram?
Description Symbol
Class signature
Class Operations
Class Visibility
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 7 / 19
Class Diagram cont.
Class relationships
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 8 / 19
Class Diagram Cont.
Class Diagram Example: Order System
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 9 / 19
Class Diagram Cont.
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 10 / 19
Class Diagram Cont.
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 11 / 19
Use Case Diagram
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 12 / 19
Use Case Diagram cont.
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 13 / 19
Use Case Diagram cont.
How to Draw a Use Case Diagram?
Identify the
Functionalities to be represented as use case.
Actors.
Relationships among the use cases and actors.
Give name to use cases that identify the functionalities they
performed.
Give a suitable name for actors.
Show relationships and dependencies clearly in the diagram.
Do not try to include all types of relationships, as the main
purpose of the diagram is to identify the requirements.
Use notes whenever required to clarify some important points.
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 14 / 19
Use Case Diagram - Notations
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 15 / 19
Use Case Diagram - Notations
Notation
Notation Symbol
Actor
Use case
Communication
Boundary of Sys-
tem
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 16 / 19
Use Case Diagram - Relationship
Relationship
Generalization
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 17 / 19
Use Case Diagram - Example
Sample Use Case Diagram of an order management system
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 18 / 19
Example using ER Diagram
ER Diagram
ByDr. Salamudeen Alhassan ADVANCED PROGRAMMING WITH JAVA AND UML March 30, 2022 19 / 19