SlideShare a Scribd company logo
Class Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Class and Object Diagrams
Lab Material
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Class Diagram
 A class diagram shows a set of classes, interfaces, and
collaborations and their relationships.
 Class diagrams commonly contain the following things:
 Classes
 Interfaces
 Collaborations
 Dependency
 Generalization, and
 Association relationships
 Aggregation
 Composition
 Multiplicity
3
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Class Diagram
 A class diagram shows a set of classes, interfaces, and
collaborations and their relationships.
 Class diagrams commonly contain the following things:
 Classes
 Interfaces
 Collaborations
 Dependency
 Generalization, and
 Association
 Aggregation
 Composition
 Multiplicity
4
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Steps involved
 Study the given problem statement
 Identify the classes
 Identify the attributes and behaviors (properties and methods)
 Denote visibility, data type, argument and return value type
 Identify the relationships
 Denote Relationships details
 Relationship name
 Role
 Relation direction
 Multiplicity
 Identify the possible Interface (common must methods for set of
classes) and relate
5
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Study the given problem statement
Develop an automated student registration system. The students
registration system identify the School (i.e. Arts & Sciences,
Engineering, Fine Arts, etc.) in which the student is registered. The
school offer both undergraduate and graduate programs. It also shall
Identify the current courses offered by each department and the
instructor engaged to each class to handle the course.
6
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Identify the classes
Develop an automated student registration system. The students
registration system identify the School (i.e. Arts & Sciences,
Engineering, Fine Arts, etc.) in which the student is registered. The
school offer both undergraduate and graduate programs. It also shall
Identify the current courses offered by each department and the
instructor engaged to each class to handle the course.
7
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Identify the classes
school
student
undergraduate
graduate
programs
courses
department
instructor
class
course
8
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Identify the attributes and behaviors
Develop an automated student registration system. The students
registration system identify the School (i.e. Arts & Sciences,
Engineering, Fine Arts, etc.) in which the student is registered. The
school offer both undergraduate and graduate programs. It also shall
Identify the current courses offered by each department and the
instructor engaged to each class to handle the course.
9
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Identify the classes
School
-name : String
-address : String
-id : int
-startdate : Date
+school(int id, String name):
+addStudent():bool
+removeStudent(int):bool
name
attributes
operations
10
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Denote visibility, data type…..
1. Public: Any outside classifier can use (+).
2. Protected: Any descendant of the classifier can use (#).
3. Private: Only the classifier itself can use (-).
4. Protected: public within package (~)
1. Instance: Each instance of the classifier holds its own value
for the feature.
2. Class variable: There is just one value of the feature for all
instances of the classifier. (static variable)
static variable should be underlined
* Derived variables should precede /
11
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Identify the relationships
 Generalization
 Association (general) – name, role, direction, multiplicity
 Special types:
 Aggregation (parts can exist without whole)
 Composition (parts cant exist without whole)
 Realization
12
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Identify the relationships
 Generalization
 Use to show a parent-child relationship.
Student
……
generalization
+handleClass():void
Graduate student
+attenMidexam():void
Undergraduate student
……
-ug:String
13
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Identify the relationships
 Generalization
Shape
SplineEllipsePolygon
Shape
SplineEllipsePolygon
Shared Target Style
Separate Target Style
. . .
. . .
14
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Identify the relationships
 Association (general) – name, role, direction, multiplicity
Instructor CourseTeaches
Name an association to describe its nature.
Direction triangle: direction of reading.
Instructor Course
Role: face presented to the other class.
teacher subject taught
Person Company
employee employer
15
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Identify the relationships
 Association (general) – name, role, direction, multiplicity
Instructor Course
teacher Subject taught
1..2 0..3
Multiplicity: How many objects may be connected across
an instance of an association.
Multiplicity at one end  for each object at the other end,
there must be that many objects at the near end.
Exactly one: 1
Zero or one: 0 .. 1
Many: 0 .. *
One or more: 1 .. *
Not shown  unspecified or suppressed 16
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Identify the relationships
 Aggregation (general) – name, role, direction, multiplicity
1
0..*
Department
Instructor
whole
part
1
1..*
Team
Player
whole
part
17
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Identify the relationships
 Composition (general) – name, role, direction, multiplicity
1
0..*
Account
Order
whole
part
1
1..*
School
Department
18
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Identify the possible Interface
 Identify one or more classes that
must have a set of common
operations.
 Create interface with the set of
common operations (abstract).
 Relate the classes and the interface
by Realization.
 Defines a set of operation specs
 Never defines an implementation
19
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
student registration system
name
address
...
addstudent()
removestudent()
...
School
name
studentID
Student
1..*
*
Graduate UnderGraduate
name
Department
description
Course
name
Instructor
Offers
1
1..*
Attends >
< Teaches
has
1..*1
* * 1..3 1
Assigned To ^
Chair
1
0..1
0..1
Schedule
accepted
20
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Example 1
21
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Example 2
22
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Example 3
23
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Example 4
24
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Example 5
25
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Example 6
26
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Steps involved
 Study the given problem statement
 Identify the classes
 Identify the attributes and behaviors (properties and methods)
 Denote visibility, data type, argument and return value type
 Identify the relationships
 Denote Relationships details
 Relationship name
 Role
 Relation direction
 Multiplicity
 Identify the possible Interface (common must methods for set of
classes) and relate
27
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Object Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Object Diagram
 Object diagrams model the instances of things contained in class
diagrams.
 An object diagram shows a set of objects and their relationships
at a point in time.
 This involves modeling a snapshot of the system at a moment in
time and rendering a set of objects, their state, and their
relationships.
 An object diagram covers a set of instances of the things found in
a class diagram.
29
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Object Representation
 In class diagram elements are in abstract form to represent the
blue print and
 in object diagram the elements are in concrete form to represent
the real world object.
30
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
How to model Object Diagram
 an object diagram is an instance of a class diagram.
 It implies that an object diagram consists of instances of things
used in a class diagram.
 So both diagrams are made of same basic elements but in
different form.
 To capture a particular system, numbers (classes) of class
diagrams are limited.
 However, if we consider object diagrams then we can have
unlimited number of instances, which are unique in nature.
31
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
How to model Object Diagram
 a single object diagram cannot capture all the necessary
instances or rather cannot specify all the objects of a system.
 Hence, the solution is −
1. First, analyze the system and decide which instances have important
data and association.
2. Second, consider only those instances, which will cover the
functionality.
3. Third, make some optimization as the number of instances are
unlimited.
32
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Things to be decided
 the following things are to be decided before starting the
construction of the diagram,
1. The object diagram should have a meaningful name to indicate its
purpose.
2. The most important elements are to be identified.
3. The association among objects should be clarified.
4. Values of different elements need to be captured to include in the
object diagram.
5. Add proper notes at points where more clarity is required.
33
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Class and Object Diagram 1
34
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Class and Object Diagram 2
35
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Class and Object Diagram 3
36
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Class and Object Diagram 4
37
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Class and Object Diagram 5
38
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Example – Class Diagram
39
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Example – Object Diagram
40
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Lets Try..!
41
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Class vs Object Diagram
42
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
The End
43
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Some Clarifications
44
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Some Clarifications
45
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Some Clarifications
46
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Some Clarifications
47
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
Some Clarifications
48
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
The End…
49
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam

More Related Content

What's hot

Object model
Object modelObject model
Object model
James Wong
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
Manish Kumar
 
Software Design and Modularity
Software Design and ModularitySoftware Design and Modularity
Software Design and Modularity
Danyal Ahmad
 
System Modelling
System ModellingSystem Modelling
System Modelling
Jennifer Polack
 
UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
Kartik Raghuvanshi
 
System Models in Software Engineering SE7
System Models in Software Engineering SE7System Models in Software Engineering SE7
System Models in Software Engineering SE7
koolkampus
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
Tech_MX
 
Coupling and cohesion
Coupling and cohesionCoupling and cohesion
Coupling and cohesion
Sutha31
 
CS8592-OOAD Lecture Notes Unit-1
CS8592-OOAD Lecture Notes Unit-1CS8592-OOAD Lecture Notes Unit-1
CS8592-OOAD Lecture Notes Unit-1
Gobinath Subramaniam
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
Aman Jain
 
Unified modelling language (UML)
Unified modelling language (UML)Unified modelling language (UML)
Unified modelling language (UML)
Hirra Sultan
 
Software Architecture Styles
Software Architecture StylesSoftware Architecture Styles
Software Architecture Styles
Henry Muccini
 
Conceptual dependency
Conceptual dependencyConceptual dependency
Conceptual dependency
Jismy .K.Jose
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
swapnac12
 
Object Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UMLObject Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UML
Malek Sumaiya
 
09 package diagram
09 package diagram09 package diagram
09 package diagram
Baskarkncet
 
Adbms 16 object definition language
Adbms 16 object definition languageAdbms 16 object definition language
Adbms 16 object definition language
Vaibhav Khanna
 
Java packages
Java packagesJava packages
Java packages
BHUVIJAYAVELU
 
The structure of agents
The structure of agentsThe structure of agents
The structure of agents
Anitha Purushothaman
 
Type constructor
Type constructorType constructor
Type constructor
krishnakanth gorantla
 

What's hot (20)

Object model
Object modelObject model
Object model
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
 
Software Design and Modularity
Software Design and ModularitySoftware Design and Modularity
Software Design and Modularity
 
System Modelling
System ModellingSystem Modelling
System Modelling
 
UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
 
System Models in Software Engineering SE7
System Models in Software Engineering SE7System Models in Software Engineering SE7
System Models in Software Engineering SE7
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Coupling and cohesion
Coupling and cohesionCoupling and cohesion
Coupling and cohesion
 
CS8592-OOAD Lecture Notes Unit-1
CS8592-OOAD Lecture Notes Unit-1CS8592-OOAD Lecture Notes Unit-1
CS8592-OOAD Lecture Notes Unit-1
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
 
Unified modelling language (UML)
Unified modelling language (UML)Unified modelling language (UML)
Unified modelling language (UML)
 
Software Architecture Styles
Software Architecture StylesSoftware Architecture Styles
Software Architecture Styles
 
Conceptual dependency
Conceptual dependencyConceptual dependency
Conceptual dependency
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Object Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UMLObject Oriented Modeling and Design with UML
Object Oriented Modeling and Design with UML
 
09 package diagram
09 package diagram09 package diagram
09 package diagram
 
Adbms 16 object definition language
Adbms 16 object definition languageAdbms 16 object definition language
Adbms 16 object definition language
 
Java packages
Java packagesJava packages
Java packages
 
The structure of agents
The structure of agentsThe structure of agents
The structure of agents
 
Type constructor
Type constructorType constructor
Type constructor
 

Similar to OOAD - UML - Class and Object Diagrams - Lab

Introduction to ER Diagrams
Introduction to ER DiagramsIntroduction to ER Diagrams
Introduction to ER Diagrams
Adri Jovin
 
Dad (Data Analysis And Design)
Dad (Data Analysis And Design)Dad (Data Analysis And Design)
Dad (Data Analysis And Design)
Jill Lyons
 
Java - Class Structure
Java - Class StructureJava - Class Structure
Java - Class Structure
Victer Paul
 
Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1
Synapseindiappsdevelopment
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
talha ijaz
 
OOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.pptOOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.ppt
itadmin33
 
Lecture_01.1.pptx
Lecture_01.1.pptxLecture_01.1.pptx
Lecture_01.1.pptx
RockyIslam5
 
sem3.pdf
sem3.pdfsem3.pdf
sem3.pdf
AshwaniP1
 
Database Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and HashingDatabase Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and Hashing
Prabu U
 
Learning Strategy with Groups on Page Based Students' Profiles
Learning Strategy with Groups on Page Based Students' ProfilesLearning Strategy with Groups on Page Based Students' Profiles
Learning Strategy with Groups on Page Based Students' Profiles
aciijournal
 
Dynamic Question Answer Generator An Enhanced Approach to Question Generation
Dynamic Question Answer Generator An Enhanced Approach to Question GenerationDynamic Question Answer Generator An Enhanced Approach to Question Generation
Dynamic Question Answer Generator An Enhanced Approach to Question Generation
ijtsrd
 
PythonOO.pdf oo Object Oriented programming
PythonOO.pdf oo Object Oriented programmingPythonOO.pdf oo Object Oriented programming
PythonOO.pdf oo Object Oriented programming
KhadijaKhadijaAouadi
 
Java - Basic Concepts
Java - Basic ConceptsJava - Basic Concepts
Java - Basic Concepts
Victer Paul
 
Learning strategy with groups on page based students' profiles
Learning strategy with groups on page based students' profilesLearning strategy with groups on page based students' profiles
Learning strategy with groups on page based students' profiles
aciijournal
 
CHAPTER 3 part1.pdf
CHAPTER 3 part1.pdfCHAPTER 3 part1.pdf
CHAPTER 3 part1.pdf
FacultyAnupamaAlagan
 
07slide.ppt
07slide.ppt07slide.ppt
07slide.ppt
NuurAxmed2
 
OBJECT ORIENTED PROGRAMING IN C++
OBJECT ORIENTED PROGRAMING IN C++ OBJECT ORIENTED PROGRAMING IN C++
OBJECT ORIENTED PROGRAMING IN C++
Dev Chauhan
 
Ooad 2marks
Ooad 2marksOoad 2marks
Ooad 2marks
Ash Wini
 
The College Classroom Week 10: Teaching as Research
The College Classroom Week 10: Teaching as ResearchThe College Classroom Week 10: Teaching as Research
The College Classroom Week 10: Teaching as Research
Peter Newbury
 
Ijetr042132
Ijetr042132Ijetr042132

Similar to OOAD - UML - Class and Object Diagrams - Lab (20)

Introduction to ER Diagrams
Introduction to ER DiagramsIntroduction to ER Diagrams
Introduction to ER Diagrams
 
Dad (Data Analysis And Design)
Dad (Data Analysis And Design)Dad (Data Analysis And Design)
Dad (Data Analysis And Design)
 
Java - Class Structure
Java - Class StructureJava - Class Structure
Java - Class Structure
 
Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1Synapseindia strcture of dotnet development part 1
Synapseindia strcture of dotnet development part 1
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
OOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.pptOOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.ppt
 
Lecture_01.1.pptx
Lecture_01.1.pptxLecture_01.1.pptx
Lecture_01.1.pptx
 
sem3.pdf
sem3.pdfsem3.pdf
sem3.pdf
 
Database Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and HashingDatabase Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and Hashing
 
Learning Strategy with Groups on Page Based Students' Profiles
Learning Strategy with Groups on Page Based Students' ProfilesLearning Strategy with Groups on Page Based Students' Profiles
Learning Strategy with Groups on Page Based Students' Profiles
 
Dynamic Question Answer Generator An Enhanced Approach to Question Generation
Dynamic Question Answer Generator An Enhanced Approach to Question GenerationDynamic Question Answer Generator An Enhanced Approach to Question Generation
Dynamic Question Answer Generator An Enhanced Approach to Question Generation
 
PythonOO.pdf oo Object Oriented programming
PythonOO.pdf oo Object Oriented programmingPythonOO.pdf oo Object Oriented programming
PythonOO.pdf oo Object Oriented programming
 
Java - Basic Concepts
Java - Basic ConceptsJava - Basic Concepts
Java - Basic Concepts
 
Learning strategy with groups on page based students' profiles
Learning strategy with groups on page based students' profilesLearning strategy with groups on page based students' profiles
Learning strategy with groups on page based students' profiles
 
CHAPTER 3 part1.pdf
CHAPTER 3 part1.pdfCHAPTER 3 part1.pdf
CHAPTER 3 part1.pdf
 
07slide.ppt
07slide.ppt07slide.ppt
07slide.ppt
 
OBJECT ORIENTED PROGRAMING IN C++
OBJECT ORIENTED PROGRAMING IN C++ OBJECT ORIENTED PROGRAMING IN C++
OBJECT ORIENTED PROGRAMING IN C++
 
Ooad 2marks
Ooad 2marksOoad 2marks
Ooad 2marks
 
The College Classroom Week 10: Teaching as Research
The College Classroom Week 10: Teaching as ResearchThe College Classroom Week 10: Teaching as Research
The College Classroom Week 10: Teaching as Research
 
Ijetr042132
Ijetr042132Ijetr042132
Ijetr042132
 

More from Victer Paul

OOAD - UML - Sequence and Communication Diagrams - Lab
OOAD - UML - Sequence and Communication Diagrams - LabOOAD - UML - Sequence and Communication Diagrams - Lab
OOAD - UML - Sequence and Communication Diagrams - Lab
Victer Paul
 
OOAD - Systems and Object Orientation Concepts
OOAD - Systems and Object Orientation ConceptsOOAD - Systems and Object Orientation Concepts
OOAD - Systems and Object Orientation Concepts
Victer Paul
 
Java - Strings Concepts
Java - Strings ConceptsJava - Strings Concepts
Java - Strings Concepts
Victer Paul
 
Java - Packages Concepts
Java - Packages ConceptsJava - Packages Concepts
Java - Packages Concepts
Victer Paul
 
Java - OOPS and Java Basics
Java - OOPS and Java BasicsJava - OOPS and Java Basics
Java - OOPS and Java Basics
Victer Paul
 
Java - Exception Handling Concepts
Java - Exception Handling ConceptsJava - Exception Handling Concepts
Java - Exception Handling Concepts
Victer Paul
 
Java - Object Oriented Programming Concepts
Java - Object Oriented Programming ConceptsJava - Object Oriented Programming Concepts
Java - Object Oriented Programming Concepts
Victer Paul
 
Java - File Input Output Concepts
Java - File Input Output ConceptsJava - File Input Output Concepts
Java - File Input Output Concepts
Victer Paul
 
Java - Inheritance Concepts
Java - Inheritance ConceptsJava - Inheritance Concepts
Java - Inheritance Concepts
Victer Paul
 
Java - Arrays Concepts
Java - Arrays ConceptsJava - Arrays Concepts
Java - Arrays Concepts
Victer Paul
 
Java applet programming concepts
Java  applet programming conceptsJava  applet programming concepts
Java applet programming concepts
Victer Paul
 

More from Victer Paul (11)

OOAD - UML - Sequence and Communication Diagrams - Lab
OOAD - UML - Sequence and Communication Diagrams - LabOOAD - UML - Sequence and Communication Diagrams - Lab
OOAD - UML - Sequence and Communication Diagrams - Lab
 
OOAD - Systems and Object Orientation Concepts
OOAD - Systems and Object Orientation ConceptsOOAD - Systems and Object Orientation Concepts
OOAD - Systems and Object Orientation Concepts
 
Java - Strings Concepts
Java - Strings ConceptsJava - Strings Concepts
Java - Strings Concepts
 
Java - Packages Concepts
Java - Packages ConceptsJava - Packages Concepts
Java - Packages Concepts
 
Java - OOPS and Java Basics
Java - OOPS and Java BasicsJava - OOPS and Java Basics
Java - OOPS and Java Basics
 
Java - Exception Handling Concepts
Java - Exception Handling ConceptsJava - Exception Handling Concepts
Java - Exception Handling Concepts
 
Java - Object Oriented Programming Concepts
Java - Object Oriented Programming ConceptsJava - Object Oriented Programming Concepts
Java - Object Oriented Programming Concepts
 
Java - File Input Output Concepts
Java - File Input Output ConceptsJava - File Input Output Concepts
Java - File Input Output Concepts
 
Java - Inheritance Concepts
Java - Inheritance ConceptsJava - Inheritance Concepts
Java - Inheritance Concepts
 
Java - Arrays Concepts
Java - Arrays ConceptsJava - Arrays Concepts
Java - Arrays Concepts
 
Java applet programming concepts
Java  applet programming conceptsJava  applet programming concepts
Java applet programming concepts
 

Recently uploaded

Online train ticket booking system project.pdf
Online train ticket booking system project.pdfOnline train ticket booking system project.pdf
Online train ticket booking system project.pdf
Kamal Acharya
 
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdfFUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
EMERSON EDUARDO RODRIGUES
 
SPICE PARK JUL2024 ( 6,866 SPICE Models )
SPICE PARK JUL2024 ( 6,866 SPICE Models )SPICE PARK JUL2024 ( 6,866 SPICE Models )
SPICE PARK JUL2024 ( 6,866 SPICE Models )
Tsuyoshi Horigome
 
SMT process how to making and defects finding
SMT process how to making and defects findingSMT process how to making and defects finding
SMT process how to making and defects finding
rameshqapcba
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
DharmaBanothu
 
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASICINTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
GOKULKANNANMMECLECTC
 
comptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdfcomptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdf
foxlyon
 
College Call Girls Kolkata 🔥 7014168258 🔥 Real Fun With Sexual Girl Available...
College Call Girls Kolkata 🔥 7014168258 🔥 Real Fun With Sexual Girl Available...College Call Girls Kolkata 🔥 7014168258 🔥 Real Fun With Sexual Girl Available...
College Call Girls Kolkata 🔥 7014168258 🔥 Real Fun With Sexual Girl Available...
Ak47
 
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
DharmaBanothu
 
paper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdfpaper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdf
ShurooqTaib
 
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Tsuyoshi Horigome
 
BBOC407 Module 1.pptx Biology for Engineers
BBOC407  Module 1.pptx Biology for EngineersBBOC407  Module 1.pptx Biology for Engineers
BBOC407 Module 1.pptx Biology for Engineers
sathishkumars808912
 
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
AK47
 
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls ChennaiCall Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
paraasingh12 #V08
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
felixwold
 
My Airframe Metallic Design Capability Studies..pdf
My Airframe Metallic Design Capability Studies..pdfMy Airframe Metallic Design Capability Studies..pdf
My Airframe Metallic Design Capability Studies..pdf
Geoffrey Wardle. MSc. MSc. Snr.MAIAA
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
ijseajournal
 
Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
MuhammadJazib15
 
High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...
High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...
High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...
dABGO KI CITy kUSHINAGAR Ak47
 
DELTA V MES EMERSON EDUARDO RODRIGUES ENGINEER
DELTA V MES EMERSON EDUARDO RODRIGUES ENGINEERDELTA V MES EMERSON EDUARDO RODRIGUES ENGINEER
DELTA V MES EMERSON EDUARDO RODRIGUES ENGINEER
EMERSON EDUARDO RODRIGUES
 

Recently uploaded (20)

Online train ticket booking system project.pdf
Online train ticket booking system project.pdfOnline train ticket booking system project.pdf
Online train ticket booking system project.pdf
 
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdfFUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
 
SPICE PARK JUL2024 ( 6,866 SPICE Models )
SPICE PARK JUL2024 ( 6,866 SPICE Models )SPICE PARK JUL2024 ( 6,866 SPICE Models )
SPICE PARK JUL2024 ( 6,866 SPICE Models )
 
SMT process how to making and defects finding
SMT process how to making and defects findingSMT process how to making and defects finding
SMT process how to making and defects finding
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
 
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASICINTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
INTRODUCTION TO ARTIFICIAL INTELLIGENCE BASIC
 
comptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdfcomptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdf
 
College Call Girls Kolkata 🔥 7014168258 🔥 Real Fun With Sexual Girl Available...
College Call Girls Kolkata 🔥 7014168258 🔥 Real Fun With Sexual Girl Available...College Call Girls Kolkata 🔥 7014168258 🔥 Real Fun With Sexual Girl Available...
College Call Girls Kolkata 🔥 7014168258 🔥 Real Fun With Sexual Girl Available...
 
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
An In-Depth Exploration of Natural Language Processing: Evolution, Applicatio...
 
paper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdfpaper relate Chozhavendhan et al. 2020.pdf
paper relate Chozhavendhan et al. 2020.pdf
 
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
Update 40 models( Solar Cell ) in SPICE PARK(JUL2024)
 
BBOC407 Module 1.pptx Biology for Engineers
BBOC407  Module 1.pptx Biology for EngineersBBOC407  Module 1.pptx Biology for Engineers
BBOC407 Module 1.pptx Biology for Engineers
 
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
🔥Independent Call Girls In Pune 💯Call Us 🔝 7014168258 🔝💃Independent Pune Esco...
 
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls ChennaiCall Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
 
My Airframe Metallic Design Capability Studies..pdf
My Airframe Metallic Design Capability Studies..pdfMy Airframe Metallic Design Capability Studies..pdf
My Airframe Metallic Design Capability Studies..pdf
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
 
Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
 
High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...
High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...
High Profile Call Girls Ahmedabad 🔥 7737669865 🔥 Real Fun With Sexual Girl Av...
 
DELTA V MES EMERSON EDUARDO RODRIGUES ENGINEER
DELTA V MES EMERSON EDUARDO RODRIGUES ENGINEERDELTA V MES EMERSON EDUARDO RODRIGUES ENGINEER
DELTA V MES EMERSON EDUARDO RODRIGUES ENGINEER
 

OOAD - UML - Class and Object Diagrams - Lab

  • 1. Class Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 2. Class and Object Diagrams Lab Material Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 3. Class Diagram  A class diagram shows a set of classes, interfaces, and collaborations and their relationships.  Class diagrams commonly contain the following things:  Classes  Interfaces  Collaborations  Dependency  Generalization, and  Association relationships  Aggregation  Composition  Multiplicity 3 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 4. Class Diagram  A class diagram shows a set of classes, interfaces, and collaborations and their relationships.  Class diagrams commonly contain the following things:  Classes  Interfaces  Collaborations  Dependency  Generalization, and  Association  Aggregation  Composition  Multiplicity 4 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 5. Steps involved  Study the given problem statement  Identify the classes  Identify the attributes and behaviors (properties and methods)  Denote visibility, data type, argument and return value type  Identify the relationships  Denote Relationships details  Relationship name  Role  Relation direction  Multiplicity  Identify the possible Interface (common must methods for set of classes) and relate 5 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 6. Study the given problem statement Develop an automated student registration system. The students registration system identify the School (i.e. Arts & Sciences, Engineering, Fine Arts, etc.) in which the student is registered. The school offer both undergraduate and graduate programs. It also shall Identify the current courses offered by each department and the instructor engaged to each class to handle the course. 6 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 7. Identify the classes Develop an automated student registration system. The students registration system identify the School (i.e. Arts & Sciences, Engineering, Fine Arts, etc.) in which the student is registered. The school offer both undergraduate and graduate programs. It also shall Identify the current courses offered by each department and the instructor engaged to each class to handle the course. 7 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 9. Identify the attributes and behaviors Develop an automated student registration system. The students registration system identify the School (i.e. Arts & Sciences, Engineering, Fine Arts, etc.) in which the student is registered. The school offer both undergraduate and graduate programs. It also shall Identify the current courses offered by each department and the instructor engaged to each class to handle the course. 9 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 10. Identify the classes School -name : String -address : String -id : int -startdate : Date +school(int id, String name): +addStudent():bool +removeStudent(int):bool name attributes operations 10 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 11. Denote visibility, data type….. 1. Public: Any outside classifier can use (+). 2. Protected: Any descendant of the classifier can use (#). 3. Private: Only the classifier itself can use (-). 4. Protected: public within package (~) 1. Instance: Each instance of the classifier holds its own value for the feature. 2. Class variable: There is just one value of the feature for all instances of the classifier. (static variable) static variable should be underlined * Derived variables should precede / 11 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 12. Identify the relationships  Generalization  Association (general) – name, role, direction, multiplicity  Special types:  Aggregation (parts can exist without whole)  Composition (parts cant exist without whole)  Realization 12 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 13. Identify the relationships  Generalization  Use to show a parent-child relationship. Student …… generalization +handleClass():void Graduate student +attenMidexam():void Undergraduate student …… -ug:String 13 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 14. Identify the relationships  Generalization Shape SplineEllipsePolygon Shape SplineEllipsePolygon Shared Target Style Separate Target Style . . . . . . 14 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 15. Identify the relationships  Association (general) – name, role, direction, multiplicity Instructor CourseTeaches Name an association to describe its nature. Direction triangle: direction of reading. Instructor Course Role: face presented to the other class. teacher subject taught Person Company employee employer 15 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 16. Identify the relationships  Association (general) – name, role, direction, multiplicity Instructor Course teacher Subject taught 1..2 0..3 Multiplicity: How many objects may be connected across an instance of an association. Multiplicity at one end  for each object at the other end, there must be that many objects at the near end. Exactly one: 1 Zero or one: 0 .. 1 Many: 0 .. * One or more: 1 .. * Not shown  unspecified or suppressed 16 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 17. Identify the relationships  Aggregation (general) – name, role, direction, multiplicity 1 0..* Department Instructor whole part 1 1..* Team Player whole part 17 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 18. Identify the relationships  Composition (general) – name, role, direction, multiplicity 1 0..* Account Order whole part 1 1..* School Department 18 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 19. Identify the possible Interface  Identify one or more classes that must have a set of common operations.  Create interface with the set of common operations (abstract).  Relate the classes and the interface by Realization.  Defines a set of operation specs  Never defines an implementation 19 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 20. student registration system name address ... addstudent() removestudent() ... School name studentID Student 1..* * Graduate UnderGraduate name Department description Course name Instructor Offers 1 1..* Attends > < Teaches has 1..*1 * * 1..3 1 Assigned To ^ Chair 1 0..1 0..1 Schedule accepted 20 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 21. Example 1 21 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 22. Example 2 22 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 23. Example 3 23 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 24. Example 4 24 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 25. Example 5 25 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 26. Example 6 26 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 27. Steps involved  Study the given problem statement  Identify the classes  Identify the attributes and behaviors (properties and methods)  Denote visibility, data type, argument and return value type  Identify the relationships  Denote Relationships details  Relationship name  Role  Relation direction  Multiplicity  Identify the possible Interface (common must methods for set of classes) and relate 27 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 28. Object Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 29. Object Diagram  Object diagrams model the instances of things contained in class diagrams.  An object diagram shows a set of objects and their relationships at a point in time.  This involves modeling a snapshot of the system at a moment in time and rendering a set of objects, their state, and their relationships.  An object diagram covers a set of instances of the things found in a class diagram. 29 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 30. Object Representation  In class diagram elements are in abstract form to represent the blue print and  in object diagram the elements are in concrete form to represent the real world object. 30 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 31. How to model Object Diagram  an object diagram is an instance of a class diagram.  It implies that an object diagram consists of instances of things used in a class diagram.  So both diagrams are made of same basic elements but in different form.  To capture a particular system, numbers (classes) of class diagrams are limited.  However, if we consider object diagrams then we can have unlimited number of instances, which are unique in nature. 31 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 32. How to model Object Diagram  a single object diagram cannot capture all the necessary instances or rather cannot specify all the objects of a system.  Hence, the solution is − 1. First, analyze the system and decide which instances have important data and association. 2. Second, consider only those instances, which will cover the functionality. 3. Third, make some optimization as the number of instances are unlimited. 32 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 33. Things to be decided  the following things are to be decided before starting the construction of the diagram, 1. The object diagram should have a meaningful name to indicate its purpose. 2. The most important elements are to be identified. 3. The association among objects should be clarified. 4. Values of different elements need to be captured to include in the object diagram. 5. Add proper notes at points where more clarity is required. 33 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 34. Class and Object Diagram 1 34 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 35. Class and Object Diagram 2 35 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 36. Class and Object Diagram 3 36 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 37. Class and Object Diagram 4 37 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 38. Class and Object Diagram 5 38 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 39. Example – Class Diagram 39 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 40. Example – Object Diagram 40 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 41. Lets Try..! 41 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 42. Class vs Object Diagram 42 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 43. The End 43 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 44. Some Clarifications 44 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 45. Some Clarifications 45 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 46. Some Clarifications 46 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 47. Some Clarifications 47 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 48. Some Clarifications 48 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 49. The End… 49 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam