SlideShare a Scribd company logo
Prepared By
Rajendra Kumar Rajouria
UCER Naini,Allahabad
Object Oriented System Design (KCS-054)
Lecture-1
INDEX
 Introduction:
 The meaning of Object Orientation,
 object identity
 Example
 information hiding
 Polymorphism
 Generosity
 Importance of modelling
 Principles of modelling
 Object oriented modelling
Object Oriented System Design
Course Outcome ( CO)
 CO 1 Understand the application development and analyze the insights
of object oriented programming to implement application K2, K4
 CO 2 Understand, analyze and apply the role of overall modeling
concepts (i.e. System, structural) K2, K3
 CO 3 Understand, analyze and apply oops concepts (i.e. abstraction,
inheritance) K2, K3, K4
 CO 4 Understand the basic concepts of C++ to implement the object
oriented concepts K2, K3
 CO 5 To understand the object oriented approach to implement real
world problem. K2, K3
A Brief History
The object-oriented paradigm took its shape from the
initial concept of a new programming approach, while the
interest in design and analysis methods came much later.
 The first object–oriented language was Simula (Simulation
of real systems) that was developed in 1960 by
researchers at the Norwegian Computing Center.
 In 1970, Alan Kay and his research group at Xerox PARK
created a personal computer named Dynabook and the
first pure object-oriented programming language (OOPL) -
Smalltalk, for programming the Dynabook.
Object-Oriented Analysis
Grady Booch has defined OOA as,
“Object-oriented analysis is a method of analysis that examines requirements from the perspective of the classes and objects found in the vocabulary of the problem domain”.
 In the 1980s, Grady Booch published a paper titled
Object Oriented Design that mainly presented a design
for the programming language, Ada. In the ensuing
editions, he extended his ideas to a complete object–
oriented design method.
 In the 1990s, Coad incorporated behavioral ideas to
object-oriented methods.
The meaning of Object Orientation
Think of objects as real-life entities. For instance, a car can be an
object with properties like color, model, speed, and actions like
accelerating and braking. In OOP, we encapsulate these properties
and actions into a class entity. Classes serve as blueprints for
creating objects.
Object-oriented programming (OOP) is a computer programming model
that organizes software design around data, or objects, rather than
functions and logic. An object can be defined as a data field that
has unique attributes and behavior.
Once an object is known, it is labeled with a class of objects that
defines the kind of data it contains and any logic sequences that can
manipulate it. Each distinct logic sequence is known as a method.
Objects can communicate with well-defined interfaces called
messages.
The structure, or building blocks, of object-oriented programming
include the following:
 Classes are user-defined data types that act as the blueprint for individual
objects, attributes and methods.
 Objects are instances of a class created with specifically defined data.
Objects can correspond to real-world objects or an abstract entity. When
class is defined initially, the description is the only object that is defined.
 Methods are functions that objects can perform. They are defined inside a
class that describe the behaviors of an object. Each method contained in class
definitions starts with a reference to an instance object. Additionally, the
subroutines contained in an object are called instance methods. Programmers
use methods for reusability or keeping functionality encapsulated inside one
object at a time.
 Attributes represent the state of an object. In other words, they are the
characteristics that distinguish classes. Objects have data stored in the
attributes field. Class attributes belong to the class itself and are defined in
the class template.
Object identity
 Object identity: An object retains its identity even if some or all of the
values of variables or definitions of methods change over time.
 Object identity is a property of data that is created in the context of an
object data model, where an object is assigned a unique internal object
identifier.
 Object identity is a stronger notion of identity than typically found in
programming languages or in data models not based on object orientation.
Several forms of identity: value: A data value is used for identity (e.g., the
primary key of a tuple in a relational database).
 Object identity is typically implemented via a unique, system-generated OID.
The value of the OID is not visible to the external user, but is used internally
by the system to identify each object uniquely and to create and manage
inter-object references.
Class
 A class represents a collection of objects having
same characteristic properties that exhibit
common behavior.
 It gives the blueprint or description of the
objects that can be created from it.
 Creation of an object as a member of a class is
called instantiation.
 Thus, object is an instance of a class.
Encapsulation
 Object-Oriented Programming (OOP) is commonly used to develop complex
software systems. It is a programming paradigm based on the concept of “objects”
that provides an organized approach to solving problems by breaking down a
system into smaller, more manageable objects. These objects can represent real-
world entities or abstract concepts.
 Encapsulation is a key concept in OOP. This concept involves combining data and
the methods that operate on it into single unit, called as class. Encapsulation
creates a layer that protects data from accidental modification, enhances code
organization, and streamlines interaction between program components.
 Consider a car. The car body contains the engine, transmission, and brakes. You
can interact with the car using its controls (steering wheel, accelerator, and brake
pedal), but you don’t need to understand how they function. This is similar to the
way encapsulation works in programming.
How Encapsulation Works
 To achieve encapsulation, you typically:
 Declare data members as private: This restricts direct
access to the data from outside the class.
 Provide public methods (getters and setters): These
methods act as intermediaries, allowing controlled access
to the data. Getters retrieve data values, while setters
modify them.
 Implement data validation: Within the setter methods,
you can validate data before assigning it to the object’s
properties, ensuring data integrity.
The Benefits of Encapsulation
 Data Protection: By making data private, you prevent accidental
or intentional modification from outside the class, ensuring data
integrity.
 Increased Security: Encapsulation helps protect sensitive
information by restricting access to it.
 Code Reusability: Encapsulated classes often boast greater
reusability because they function as self-contained units with
clearly defined interfaces.
 Improved Maintainability: Changes to the internal
implementation of a class are less likely to affect other parts of
the program due to encapsulation.
Two Important property of Encapsulation
 Data Protection: Encapsulation protects the internal state
of an object by keeping its data members private. Access
to and modification of these data members is restricted to
the class’s public methods, ensuring controlled and secure
data manipulation.
 Information Hiding: Encapsulation hides the internal
implementation details of a class from external code. Only
the public interface of the class is accessible, providing
abstraction and simplifying the usage of the class while
allowing the internal implementation to be modified
without impacting external code.
Features of Encapsulation
 We can not access any function from the class directly. We need
an object to access that function that is using the member
variables of that class.
 The function which we are making inside the class must use only
member variables, only then it is called encapsulation.
 If we don’t make a function inside the class which is using the
member variable of the class then we don’t call it encapsulation.
 Encapsulation improves readability, maintainability, and security
by grouping data and methods together.
 It helps to control the modification of our data members.
How to Create Class in C++
class MyClass { // The class
public: // Access specifier
int myNum; // Attribute (int variable)
string myString; // Attribute (string
variable)
};
How to Create Object in C++
int main() {
MyClass myObj; // Create an object of MyClass
// Access attributes and set values
myObj.myNum = 15;
myObj.myString = "Some text";
// Print attribute values
cout << myObj.myNum << "n";
cout << myObj.myString;
return 0;
}
The constituents of a class are
 A set of attributes for the objects that are to be
instantiated from the class.
 Generally, different objects of a class have some
difference in the values of the attributes. Attributes are
often referred as class data.
 A set of operations that portray the behavior of the
objects of the class. Operations are also referred as
functions or methods.
Example
Let us consider a simple class, Circle, that
represents the geometrical figure circle in a two–
dimensional space.
The attributes of this class can be identified as
follows −
 x–coord, to denote x–coordinate of the center
 y–coord, to denote y–coordinate of the center
 a, to denote the radius of the circle
Some of its operations can be defined as follows −
 findArea(), method to calculate area
 findCircumference(), method to calculate
circumference
 scale(), method to increase or decrease the
radius
 During instantiation, values are assigned for at least
some of the attributes.
 If we create an object my_circle, we can assign
values like x-coord : 2, y-coord : 3, and a : 4 to
depict its state.
 Now, if the operation scale() is performed on
my_circle with a scaling factor of 2, the value of
the variable a will become 8.
 This operation brings a change in the state of
my_circle, i.e., the object has exhibited certain
behavior.
 Objects can be modelled according to the
needs of the application.
 An object may have a physical existence, like a
customer, a car, etc.; or an intangible
conceptual existence, like a project, a process,
etc.
Ad

More Related Content

Similar to OOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTS (20)

Abap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorialsAbap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorials
cesarmendez78
 
1 intro
1 intro1 intro
1 intro
abha48
 
Oops
OopsOops
Oops
Jaya Kumari
 
Mca 504 dotnet_unit3
Mca 504 dotnet_unit3Mca 504 dotnet_unit3
Mca 504 dotnet_unit3
Rai Saheb Bhanwar Singh College Nasrullaganj
 
Object Oriented Programming Language is an oop
Object Oriented Programming Language is an oopObject Oriented Programming Language is an oop
Object Oriented Programming Language is an oop
sanaiftikhar23
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
hijat789
 
Ooad notes
Ooad notesOoad notes
Ooad notes
NancyJP
 
Object Oriented Programming fundamentals.pptx
Object Oriented Programming fundamentals.pptxObject Oriented Programming fundamentals.pptx
Object Oriented Programming fundamentals.pptx
sanaiftikhar23
 
Object oriented basics
Object oriented basicsObject oriented basics
Object oriented basics
vamshimahi
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
RamadossSundaramoort1
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
kaavyashruthi
 
Understanding-Objects-in-Javascript.pptx
Understanding-Objects-in-Javascript.pptxUnderstanding-Objects-in-Javascript.pptx
Understanding-Objects-in-Javascript.pptx
MariaTrinidadTumanga
 
Computer_Programming_Part_II_Segment_01.pdf
Computer_Programming_Part_II_Segment_01.pdfComputer_Programming_Part_II_Segment_01.pdf
Computer_Programming_Part_II_Segment_01.pdf
et243047
 
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit 5.ppt
JITTAYASHWANTHREDDY
 
PHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptxPHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptx
Atikur Rahman
 
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
CS3391 -OOP -UNIT – I  NOTES FINAL.pdfCS3391 -OOP -UNIT – I  NOTES FINAL.pdf
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
 
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
AnkurSingh340457
 
Oomd unit1
Oomd unit1Oomd unit1
Oomd unit1
VivekChaudhary93
 
Java chapter 3
Java   chapter 3Java   chapter 3
Java chapter 3
Mukesh Tekwani
 
Php oop (1)
Php oop (1)Php oop (1)
Php oop (1)
Sudip Simkhada
 
Abap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorialsAbap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorials
cesarmendez78
 
1 intro
1 intro1 intro
1 intro
abha48
 
Object Oriented Programming Language is an oop
Object Oriented Programming Language is an oopObject Oriented Programming Language is an oop
Object Oriented Programming Language is an oop
sanaiftikhar23
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
hijat789
 
Ooad notes
Ooad notesOoad notes
Ooad notes
NancyJP
 
Object Oriented Programming fundamentals.pptx
Object Oriented Programming fundamentals.pptxObject Oriented Programming fundamentals.pptx
Object Oriented Programming fundamentals.pptx
sanaiftikhar23
 
Object oriented basics
Object oriented basicsObject oriented basics
Object oriented basics
vamshimahi
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
RamadossSundaramoort1
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
kaavyashruthi
 
Understanding-Objects-in-Javascript.pptx
Understanding-Objects-in-Javascript.pptxUnderstanding-Objects-in-Javascript.pptx
Understanding-Objects-in-Javascript.pptx
MariaTrinidadTumanga
 
Computer_Programming_Part_II_Segment_01.pdf
Computer_Programming_Part_II_Segment_01.pdfComputer_Programming_Part_II_Segment_01.pdf
Computer_Programming_Part_II_Segment_01.pdf
et243047
 
PHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptxPHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptx
Atikur Rahman
 
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
AnkurSingh340457
 

Recently uploaded (20)

CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Ad

OOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTS

  • 1. Prepared By Rajendra Kumar Rajouria UCER Naini,Allahabad Object Oriented System Design (KCS-054) Lecture-1
  • 2. INDEX  Introduction:  The meaning of Object Orientation,  object identity  Example  information hiding  Polymorphism  Generosity  Importance of modelling  Principles of modelling  Object oriented modelling
  • 3. Object Oriented System Design Course Outcome ( CO)  CO 1 Understand the application development and analyze the insights of object oriented programming to implement application K2, K4  CO 2 Understand, analyze and apply the role of overall modeling concepts (i.e. System, structural) K2, K3  CO 3 Understand, analyze and apply oops concepts (i.e. abstraction, inheritance) K2, K3, K4  CO 4 Understand the basic concepts of C++ to implement the object oriented concepts K2, K3  CO 5 To understand the object oriented approach to implement real world problem. K2, K3
  • 4. A Brief History The object-oriented paradigm took its shape from the initial concept of a new programming approach, while the interest in design and analysis methods came much later.  The first object–oriented language was Simula (Simulation of real systems) that was developed in 1960 by researchers at the Norwegian Computing Center.  In 1970, Alan Kay and his research group at Xerox PARK created a personal computer named Dynabook and the first pure object-oriented programming language (OOPL) - Smalltalk, for programming the Dynabook.
  • 5. Object-Oriented Analysis Grady Booch has defined OOA as, “Object-oriented analysis is a method of analysis that examines requirements from the perspective of the classes and objects found in the vocabulary of the problem domain”.
  • 6.  In the 1980s, Grady Booch published a paper titled Object Oriented Design that mainly presented a design for the programming language, Ada. In the ensuing editions, he extended his ideas to a complete object– oriented design method.  In the 1990s, Coad incorporated behavioral ideas to object-oriented methods.
  • 7. The meaning of Object Orientation Think of objects as real-life entities. For instance, a car can be an object with properties like color, model, speed, and actions like accelerating and braking. In OOP, we encapsulate these properties and actions into a class entity. Classes serve as blueprints for creating objects. Object-oriented programming (OOP) is a computer programming model that organizes software design around data, or objects, rather than functions and logic. An object can be defined as a data field that has unique attributes and behavior. Once an object is known, it is labeled with a class of objects that defines the kind of data it contains and any logic sequences that can manipulate it. Each distinct logic sequence is known as a method. Objects can communicate with well-defined interfaces called messages.
  • 8. The structure, or building blocks, of object-oriented programming include the following:  Classes are user-defined data types that act as the blueprint for individual objects, attributes and methods.  Objects are instances of a class created with specifically defined data. Objects can correspond to real-world objects or an abstract entity. When class is defined initially, the description is the only object that is defined.  Methods are functions that objects can perform. They are defined inside a class that describe the behaviors of an object. Each method contained in class definitions starts with a reference to an instance object. Additionally, the subroutines contained in an object are called instance methods. Programmers use methods for reusability or keeping functionality encapsulated inside one object at a time.  Attributes represent the state of an object. In other words, they are the characteristics that distinguish classes. Objects have data stored in the attributes field. Class attributes belong to the class itself and are defined in the class template.
  • 9. Object identity  Object identity: An object retains its identity even if some or all of the values of variables or definitions of methods change over time.  Object identity is a property of data that is created in the context of an object data model, where an object is assigned a unique internal object identifier.  Object identity is a stronger notion of identity than typically found in programming languages or in data models not based on object orientation. Several forms of identity: value: A data value is used for identity (e.g., the primary key of a tuple in a relational database).  Object identity is typically implemented via a unique, system-generated OID. The value of the OID is not visible to the external user, but is used internally by the system to identify each object uniquely and to create and manage inter-object references.
  • 10. Class  A class represents a collection of objects having same characteristic properties that exhibit common behavior.  It gives the blueprint or description of the objects that can be created from it.  Creation of an object as a member of a class is called instantiation.  Thus, object is an instance of a class.
  • 11. Encapsulation  Object-Oriented Programming (OOP) is commonly used to develop complex software systems. It is a programming paradigm based on the concept of “objects” that provides an organized approach to solving problems by breaking down a system into smaller, more manageable objects. These objects can represent real- world entities or abstract concepts.  Encapsulation is a key concept in OOP. This concept involves combining data and the methods that operate on it into single unit, called as class. Encapsulation creates a layer that protects data from accidental modification, enhances code organization, and streamlines interaction between program components.  Consider a car. The car body contains the engine, transmission, and brakes. You can interact with the car using its controls (steering wheel, accelerator, and brake pedal), but you don’t need to understand how they function. This is similar to the way encapsulation works in programming.
  • 12. How Encapsulation Works  To achieve encapsulation, you typically:  Declare data members as private: This restricts direct access to the data from outside the class.  Provide public methods (getters and setters): These methods act as intermediaries, allowing controlled access to the data. Getters retrieve data values, while setters modify them.  Implement data validation: Within the setter methods, you can validate data before assigning it to the object’s properties, ensuring data integrity.
  • 13. The Benefits of Encapsulation  Data Protection: By making data private, you prevent accidental or intentional modification from outside the class, ensuring data integrity.  Increased Security: Encapsulation helps protect sensitive information by restricting access to it.  Code Reusability: Encapsulated classes often boast greater reusability because they function as self-contained units with clearly defined interfaces.  Improved Maintainability: Changes to the internal implementation of a class are less likely to affect other parts of the program due to encapsulation.
  • 14. Two Important property of Encapsulation  Data Protection: Encapsulation protects the internal state of an object by keeping its data members private. Access to and modification of these data members is restricted to the class’s public methods, ensuring controlled and secure data manipulation.  Information Hiding: Encapsulation hides the internal implementation details of a class from external code. Only the public interface of the class is accessible, providing abstraction and simplifying the usage of the class while allowing the internal implementation to be modified without impacting external code.
  • 15. Features of Encapsulation  We can not access any function from the class directly. We need an object to access that function that is using the member variables of that class.  The function which we are making inside the class must use only member variables, only then it is called encapsulation.  If we don’t make a function inside the class which is using the member variable of the class then we don’t call it encapsulation.  Encapsulation improves readability, maintainability, and security by grouping data and methods together.  It helps to control the modification of our data members.
  • 16. How to Create Class in C++ class MyClass { // The class public: // Access specifier int myNum; // Attribute (int variable) string myString; // Attribute (string variable) };
  • 17. How to Create Object in C++ int main() { MyClass myObj; // Create an object of MyClass // Access attributes and set values myObj.myNum = 15; myObj.myString = "Some text"; // Print attribute values cout << myObj.myNum << "n"; cout << myObj.myString; return 0; }
  • 18. The constituents of a class are  A set of attributes for the objects that are to be instantiated from the class.  Generally, different objects of a class have some difference in the values of the attributes. Attributes are often referred as class data.  A set of operations that portray the behavior of the objects of the class. Operations are also referred as functions or methods.
  • 19. Example Let us consider a simple class, Circle, that represents the geometrical figure circle in a two– dimensional space. The attributes of this class can be identified as follows −  x–coord, to denote x–coordinate of the center  y–coord, to denote y–coordinate of the center  a, to denote the radius of the circle
  • 20. Some of its operations can be defined as follows −  findArea(), method to calculate area  findCircumference(), method to calculate circumference  scale(), method to increase or decrease the radius
  • 21.  During instantiation, values are assigned for at least some of the attributes.  If we create an object my_circle, we can assign values like x-coord : 2, y-coord : 3, and a : 4 to depict its state.  Now, if the operation scale() is performed on my_circle with a scaling factor of 2, the value of the variable a will become 8.  This operation brings a change in the state of my_circle, i.e., the object has exhibited certain behavior.
  • 22.  Objects can be modelled according to the needs of the application.  An object may have a physical existence, like a customer, a car, etc.; or an intangible conceptual existence, like a project, a process, etc.