SlideShare a Scribd company logo
1 of 14
Download to read offline
CST 205 Object Oriented Programming using Java
CST 281 Object Oriented Programming
(As per KTU 2019 Syllabus)
Course overview & Module 1
Module 1
► Approaches to Software Design. Functional Oriented Design, Object
Oriented Design, Case Study of Automated Fire Alarm System
► Object Modeling Using Unified Modeling Language. Basic Object Oriented
concepts, UML diagrams, Use case model, Class diagram, Interaction diagram,
Activity diagram, State chart diagram
► Introduction to Java Java programming. Environment and Runtime
Environment, Development Platforms - Standard, Enterprise. Java Virtual
Machine, Java compiler, Bytecode, Java applet Java Buzzwords, Java program
structure, Comments, Garbage Collection, Lexical Issues
Class Diagram
● Class diagram in the UML is a type of static structure diagram to represent the
design of the software system in terms of classes and their relationships..
● It shows the structure of a system at the level of classes and interfaces, along
with their attributes, operations, and the relationships among objects.
● There are several software tools available create UML Class diagrams. Rational
rose, StarUML and Lucidchart are some of the popular tools.
● Some common types of class diagrams are:
1. Domain Model Diagram - representation of real-world conceptual classes (contains only attributes),
not of software components, to understand the project domain.
2. Implementation Classes Diagram - representation of the structure of software components,
describes classes, interfaces, associations, usage, realization.
UML notation for Class
A class notation consists of three parts:
1. Class Name (mandatory):
○ The name of the class appears in the first
partition.
2. Class Attributes[optional]:
○ An attribute is a named property of a class that
describes the object being modeled
○ Attributes are shown in the second partition.
○ The attribute type is shown after the colon.
○ Derived attribute is designated by a preceding ‘/’
○ Attributes map onto member variables (data members) in code.
3. Class Operations(Methods)[optional]:
○ Operations are shown in the third partition. They are services the class provides.
○ The return type of a method is shown after the colon at the end of the method signature.
○ Operations map onto class methods in code
Member visibility
● Visibility defines whether attributes and
operations of specific classes can be seen and
used by other classes
● UML has 4 types of visibility and it is
represented by prefixing a literal( +, -, #, ~)
Member visibility
PRIVATE
DEFAULT /
PACKAGE
PUBLIC
PROTECTED
Member scope
● The UML specifies two types of scope for
members: instance and classifier.
● Classifier members are commonly
recognized as “static” in many programming
languages. The scope is the class itself.
○ All the instances share the classifier scoped
members.
● To indicate a classifier scope for a member,
its name must be underlined. Otherwise,
instance scope is assumed by default.
● Instance members are scoped to a specific
instance.
○ Each instantiated object of the class has its own
copy of the instance members.
Relationships between classes
Relationships in class diagrams include
different types of logical connections.
Relationships between classes
1. Association
● Represents static relationships between two classes.
● Shows that instances of classes could be either linked to each
other or combined logically or physically.
● Represented by a solid line (with or without open arrow)
connecting two classes
2. Dependency
● A dependency means the relation between two or more classes
in which a change in one may force changes in the other.
● Dependency indicates that one class depends on another.
● A dashed line with an open arrow
Relationships between classes
4. Aggregation
● A special type of association to represent a "has a" relationship eg. Team has 9 Players
● A solid line with an unfilled diamond at the association end connected to the class of
composite
5. Composition
● A special type of aggregation where parts are destroyed when the whole is destroyed.
● A solid line with a filled diamond at the association connected to the class of composite
Relationships between classes
6. Generalization (Inheritance)
● A generalization helps to connect a subclass to its superclass.
● A sub-class is inherited from its superclass.
● A solid line with a hollow arrowhead that point from the child to the parent class
7. Realization (Implements)
● Realization relationship is a relationship between two model elements, in which
one model element (the client) realizes (implements or executes) the behavior
that the other model element (the supplier) specifies.
Relationships between classes
Multiplicity
● Multiplicity defines how
many objects participate in a
relationship and it is the
number of instances of one
class related to one instance
of the other class.
● Multiplicity is represented as
a number and a * is used to
represent a multiplicity of
many
Class diagram for a Pizza Order system
References
● Rajib Mall, Fundamentals of Software Engineering, 4th edition, PHI, 2014.
● UML Diagrams - www.uml-diagrams.org
● Visual Paradigm - www.visual-paradigm.com
● GeeksforGeeks - www.geeksforgeeks.org
● Wikipedia - www.wikipedia.org
● Tutorialspoint - www.tutorialspoint.com
● Disclaimer - This document contains images/texts from various internet sources. Copyright belongs to the
respective content creators. Document is compiled exclusively for study purpose and shall not be used for
commercial purpose.

More Related Content

What's hot

Library management system
Library management systemLibrary management system
Library management systemArman Ahmed
 
Software requirements specification of Library Management System
Software requirements specification of Library Management SystemSoftware requirements specification of Library Management System
Software requirements specification of Library Management SystemSoumili Sen
 
Object-oriented Programming-with C#
Object-oriented Programming-with C#Object-oriented Programming-with C#
Object-oriented Programming-with C#Doncho Minkov
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivityTanmoy Barman
 
SOLID Principles and The Clean Architecture
SOLID Principles and The Clean ArchitectureSOLID Principles and The Clean Architecture
SOLID Principles and The Clean ArchitectureMohamed Galal
 
Advanced Structural Modeling
Advanced Structural ModelingAdvanced Structural Modeling
Advanced Structural ModelingAMITJain879
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingMd. Tanvir Hossain
 
Ngo management system.
Ngo management system.Ngo management system.
Ngo management system.PallaviKadam
 
Lect 1-class and object
Lect 1-class and objectLect 1-class and object
Lect 1-class and objectFajar Baskoro
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentationBhavin Shah
 
Coupling , Cohesion and there Types
Coupling , Cohesion and there TypesCoupling , Cohesion and there Types
Coupling , Cohesion and there TypesMunaam Munawar
 
C# Exceptions Handling
C# Exceptions Handling C# Exceptions Handling
C# Exceptions Handling sharqiyem
 
Defining the Problem - Goals and requirements
Defining the Problem - Goals and requirementsDefining the Problem - Goals and requirements
Defining the Problem - Goals and requirementsStephennancy
 
Software architecture patterns
Software architecture patternsSoftware architecture patterns
Software architecture patternsRiccardo Cardin
 
django Forms in a Web API World
django Forms in a Web API Worlddjango Forms in a Web API World
django Forms in a Web API WorldTareque Hossain
 
Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...Edureka!
 

What's hot (20)

Data types in java
Data types in javaData types in java
Data types in java
 
Lecture 1 oop
Lecture 1 oopLecture 1 oop
Lecture 1 oop
 
Library management system
Library management systemLibrary management system
Library management system
 
Software requirements specification of Library Management System
Software requirements specification of Library Management SystemSoftware requirements specification of Library Management System
Software requirements specification of Library Management System
 
Object-oriented Programming-with C#
Object-oriented Programming-with C#Object-oriented Programming-with C#
Object-oriented Programming-with C#
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
 
SOLID Principles and The Clean Architecture
SOLID Principles and The Clean ArchitectureSOLID Principles and The Clean Architecture
SOLID Principles and The Clean Architecture
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
Advanced Structural Modeling
Advanced Structural ModelingAdvanced Structural Modeling
Advanced Structural Modeling
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
 
Ngo management system.
Ngo management system.Ngo management system.
Ngo management system.
 
Lect 1-class and object
Lect 1-class and objectLect 1-class and object
Lect 1-class and object
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 
Coupling , Cohesion and there Types
Coupling , Cohesion and there TypesCoupling , Cohesion and there Types
Coupling , Cohesion and there Types
 
Solid principles
Solid principlesSolid principles
Solid principles
 
C# Exceptions Handling
C# Exceptions Handling C# Exceptions Handling
C# Exceptions Handling
 
Defining the Problem - Goals and requirements
Defining the Problem - Goals and requirementsDefining the Problem - Goals and requirements
Defining the Problem - Goals and requirements
 
Software architecture patterns
Software architecture patternsSoftware architecture patterns
Software architecture patterns
 
django Forms in a Web API World
django Forms in a Web API Worlddjango Forms in a Web API World
django Forms in a Web API World
 
Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...
 

Similar to Lecture 4-oop class diagram (20)

Ooad lab manual
Ooad  lab manualOoad  lab manual
Ooad lab manual
 
Unified Modelling Language
Unified Modelling Language Unified Modelling Language
Unified Modelling Language
 
DISE - OOAD Using UML
DISE - OOAD Using UMLDISE - OOAD Using UML
DISE - OOAD Using UML
 
OOP_Module 2.pptx
OOP_Module 2.pptxOOP_Module 2.pptx
OOP_Module 2.pptx
 
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
 
SMD Unit ii
SMD Unit iiSMD Unit ii
SMD Unit ii
 
Concepts of oops
Concepts of oopsConcepts of oops
Concepts of oops
 
Bai giang-uml-11feb14
Bai giang-uml-11feb14Bai giang-uml-11feb14
Bai giang-uml-11feb14
 
Css uml
Css umlCss uml
Css uml
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering
 
classdiagram.pptx
classdiagram.pptxclassdiagram.pptx
classdiagram.pptx
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Software Testing and UML Lab
Software Testing and UML LabSoftware Testing and UML Lab
Software Testing and UML Lab
 
UML Design.pptx
UML Design.pptxUML Design.pptx
UML Design.pptx
 
Intro Uml
Intro UmlIntro Uml
Intro Uml
 
Slides chapter 11
Slides chapter 11Slides chapter 11
Slides chapter 11
 
Object Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLObject Oriented Analysis Design using UML
Object Oriented Analysis Design using UML
 
Uml class-diagram
Uml class-diagramUml class-diagram
Uml class-diagram
 
Architecture and design
Architecture and designArchitecture and design
Architecture and design
 

More from ktuonlinenotes

Oop suplemnertary september 2019
Oop suplemnertary september  2019Oop suplemnertary september  2019
Oop suplemnertary september 2019ktuonlinenotes
 
Oop r&s may 2019 (2)
Oop r&s may 2019 (2)Oop r&s may 2019 (2)
Oop r&s may 2019 (2)ktuonlinenotes
 
Module 1 uml - usecase digram
Module 1   uml - usecase digramModule 1   uml - usecase digram
Module 1 uml - usecase digramktuonlinenotes
 
Module 1 uml - interaction diagram
Module 1   uml - interaction diagramModule 1   uml - interaction diagram
Module 1 uml - interaction diagramktuonlinenotes
 
Lecture1 cst205 cst281-oop
Lecture1 cst205 cst281-oopLecture1 cst205 cst281-oop
Lecture1 cst205 cst281-oopktuonlinenotes
 
Lecture 2 cst 205-281 oop
Lecture 2   cst 205-281 oopLecture 2   cst 205-281 oop
Lecture 2 cst 205-281 oopktuonlinenotes
 
Lecture 3 cst205 cst281-oop
Lecture 3 cst205 cst281-oopLecture 3 cst205 cst281-oop
Lecture 3 cst205 cst281-oopktuonlinenotes
 

More from ktuonlinenotes (12)

Oop suplemnertary september 2019
Oop suplemnertary september  2019Oop suplemnertary september  2019
Oop suplemnertary september 2019
 
Oop sample ktu
Oop sample ktuOop sample ktu
Oop sample ktu
 
Oop r&s may 2019
Oop r&s may 2019Oop r&s may 2019
Oop r&s may 2019
 
Oop r&s may 2019 (2)
Oop r&s may 2019 (2)Oop r&s may 2019 (2)
Oop r&s may 2019 (2)
 
Oop july 2017
Oop july 2017Oop july 2017
Oop july 2017
 
Oop december 2018
Oop december 2018Oop december 2018
Oop december 2018
 
Oop april 2018
Oop april 2018Oop april 2018
Oop april 2018
 
Module 1 uml - usecase digram
Module 1   uml - usecase digramModule 1   uml - usecase digram
Module 1 uml - usecase digram
 
Module 1 uml - interaction diagram
Module 1   uml - interaction diagramModule 1   uml - interaction diagram
Module 1 uml - interaction diagram
 
Lecture1 cst205 cst281-oop
Lecture1 cst205 cst281-oopLecture1 cst205 cst281-oop
Lecture1 cst205 cst281-oop
 
Lecture 2 cst 205-281 oop
Lecture 2   cst 205-281 oopLecture 2   cst 205-281 oop
Lecture 2 cst 205-281 oop
 
Lecture 3 cst205 cst281-oop
Lecture 3 cst205 cst281-oopLecture 3 cst205 cst281-oop
Lecture 3 cst205 cst281-oop
 

Recently uploaded

Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 

Recently uploaded (20)

Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

Lecture 4-oop class diagram

  • 1. CST 205 Object Oriented Programming using Java CST 281 Object Oriented Programming (As per KTU 2019 Syllabus) Course overview & Module 1
  • 2. Module 1 ► Approaches to Software Design. Functional Oriented Design, Object Oriented Design, Case Study of Automated Fire Alarm System ► Object Modeling Using Unified Modeling Language. Basic Object Oriented concepts, UML diagrams, Use case model, Class diagram, Interaction diagram, Activity diagram, State chart diagram ► Introduction to Java Java programming. Environment and Runtime Environment, Development Platforms - Standard, Enterprise. Java Virtual Machine, Java compiler, Bytecode, Java applet Java Buzzwords, Java program structure, Comments, Garbage Collection, Lexical Issues
  • 3. Class Diagram ● Class diagram in the UML is a type of static structure diagram to represent the design of the software system in terms of classes and their relationships.. ● It shows the structure of a system at the level of classes and interfaces, along with their attributes, operations, and the relationships among objects. ● There are several software tools available create UML Class diagrams. Rational rose, StarUML and Lucidchart are some of the popular tools. ● Some common types of class diagrams are: 1. Domain Model Diagram - representation of real-world conceptual classes (contains only attributes), not of software components, to understand the project domain. 2. Implementation Classes Diagram - representation of the structure of software components, describes classes, interfaces, associations, usage, realization.
  • 4. UML notation for Class A class notation consists of three parts: 1. Class Name (mandatory): ○ The name of the class appears in the first partition. 2. Class Attributes[optional]: ○ An attribute is a named property of a class that describes the object being modeled ○ Attributes are shown in the second partition. ○ The attribute type is shown after the colon. ○ Derived attribute is designated by a preceding ‘/’ ○ Attributes map onto member variables (data members) in code. 3. Class Operations(Methods)[optional]: ○ Operations are shown in the third partition. They are services the class provides. ○ The return type of a method is shown after the colon at the end of the method signature. ○ Operations map onto class methods in code
  • 5. Member visibility ● Visibility defines whether attributes and operations of specific classes can be seen and used by other classes ● UML has 4 types of visibility and it is represented by prefixing a literal( +, -, #, ~)
  • 7. Member scope ● The UML specifies two types of scope for members: instance and classifier. ● Classifier members are commonly recognized as “static” in many programming languages. The scope is the class itself. ○ All the instances share the classifier scoped members. ● To indicate a classifier scope for a member, its name must be underlined. Otherwise, instance scope is assumed by default. ● Instance members are scoped to a specific instance. ○ Each instantiated object of the class has its own copy of the instance members.
  • 8. Relationships between classes Relationships in class diagrams include different types of logical connections.
  • 9. Relationships between classes 1. Association ● Represents static relationships between two classes. ● Shows that instances of classes could be either linked to each other or combined logically or physically. ● Represented by a solid line (with or without open arrow) connecting two classes 2. Dependency ● A dependency means the relation between two or more classes in which a change in one may force changes in the other. ● Dependency indicates that one class depends on another. ● A dashed line with an open arrow
  • 10. Relationships between classes 4. Aggregation ● A special type of association to represent a "has a" relationship eg. Team has 9 Players ● A solid line with an unfilled diamond at the association end connected to the class of composite 5. Composition ● A special type of aggregation where parts are destroyed when the whole is destroyed. ● A solid line with a filled diamond at the association connected to the class of composite
  • 11. Relationships between classes 6. Generalization (Inheritance) ● A generalization helps to connect a subclass to its superclass. ● A sub-class is inherited from its superclass. ● A solid line with a hollow arrowhead that point from the child to the parent class 7. Realization (Implements) ● Realization relationship is a relationship between two model elements, in which one model element (the client) realizes (implements or executes) the behavior that the other model element (the supplier) specifies.
  • 12. Relationships between classes Multiplicity ● Multiplicity defines how many objects participate in a relationship and it is the number of instances of one class related to one instance of the other class. ● Multiplicity is represented as a number and a * is used to represent a multiplicity of many
  • 13. Class diagram for a Pizza Order system
  • 14. References ● Rajib Mall, Fundamentals of Software Engineering, 4th edition, PHI, 2014. ● UML Diagrams - www.uml-diagrams.org ● Visual Paradigm - www.visual-paradigm.com ● GeeksforGeeks - www.geeksforgeeks.org ● Wikipedia - www.wikipedia.org ● Tutorialspoint - www.tutorialspoint.com ● Disclaimer - This document contains images/texts from various internet sources. Copyright belongs to the respective content creators. Document is compiled exclusively for study purpose and shall not be used for commercial purpose.