SlideShare a Scribd company logo
1 of 20
Download to read offline
@2020 Presented By Y. N. D.
Aravind 1
Presented By
Y. N. D. ARAVIND
M.Tech, Dept of CSE
Newton’s Group Of Institutions, Macherla
@2020 Presented By Y. N. D. Aravind
Chapter 3 Classes and Objects 3
2.1 The Natue of Objects 4
2.2 Relationships among Object 7
2.3 The Natue of Classes 10
2.4 Relationships among Classes 11
2.5 Interplay of Classes and Objects 14
2.6 Identifying Classes and Objects 15
2.7 Importance of Proper Classification 18
2.8 Key abstractions and Mechanism 19
2
When we use object-oriented methods to analyze or design a complex software
system, our basic building blocks are classes and objects.
An object is an abstraction of something in a problem domain, reflecting the
capabilities of a system to keep information about it, interact with it, or both
 Objects have an internal state that is recorded in a set of attributes.
 Objects have a behavior that is expressed in terms of operations. The
execution of operations changes the state of the object and/or stimulates the
execution of operations in other objects.
 Objects (at least in the analysis phase) have an origin in a real world entity.
Classes represent groups of objects which have the same behavior and
information structures.
 Every object is an instance of a single class
 Class is a kind of type, an ADT (but with data), or an 'entity' (but with
methods)
 Classes are the same in both analysis and design
 A class defines the possible behaviors and the information structure of all its
object instances.
@2020 Presented By Y. N. D. Aravind 3
CLASSES AND OBJECTS
An object is any of the following:
1. Tangible , and /or visible thing.
2. Object represents an individual , identifiable item, entity either real world or
abstract with a well defined role in the problem domain.
3. Object has state , behavior and identity , the structure and behavior similar
objects are defined on their common class , the terms instance and object are
interchangeable..
State :- The state of an object encompasses all of the properties of the object
plus the dynamic values of each of these properties.
A property is a distinctive characteristics that contributes to making an object
uniquely that object properties are usually static because attributes such as these
are unchanging and fundamental to the nature of an object.
Behavior :- How an object acts and reacts , in terms of its state changeable state
of object affect its behavior.
@2020 Presented By Y. N. D. Aravind
4
4
The Nature of Object’s
Static + Dynamic
Operations :- Denotes a service that a class offers to its clients. These are 5
kinds off operations.
1) Modifier – Alters state of an object.
2) Selector – Access state of an object.
3) Iterator – Permits access to all parts of object in defined order.
4) Constructor – Creates object and initialize its state.
5) Destructor – Frees or destroys state of object itself.
Identity :- Property of an object which distinguishes it from all other objects.
Object Life Span :- The Life line of an object extends from the time it is first
created until that space is recalled.
Roles and Responsibilities
Role :- Role is a mask that an object wears and defines a contract between an
abstraction and its clients.
Responsibilities :- Purpose of object and its place in system.
@2020 Presented By Y. N. D. Aravind
5
5
The Nature of Object’s
Object as Machine :- The existence of state within an object means that the
order in which operations are invoked into two types „Active‟ and „Passive‟.
@2020 Presented By Y. N. D. Aravind
6
6
The Nature of Object’s
Two kinds of objects relationships
1) Links
2) Aggregation
1) Links :- Specific Association through which one object applies services of another
object.
As a participation in a link , an object may play one of three roles.
a. Controller – Operates another object.
b. Server – Operated by another object.
c. Proxy – Both operates and operated by objects.
Visibility:- It consists of four ways
a. Globally declared
b. Locally declared
c. Part of a client object
d. Programming object
Synchronization:- One object passes message to another object across a link. It consists of
three approaches.
a. Sequential
b. Guarded
c. Concurrency
@2020 Presented By Y. N. D. Aravind
7
7
Relationship among Object’s
2) Aggregation :- Aggregation is a special kind of Association . It may or may
not denote physical containment whole / part of hierarchy.
@2020 Presented By Y. N. D. Aravind
8
8
Relationship among Object’s
Class is a set of object that share a common behavior and common semantics.
Interface and Implementation:-
Interface :- Interface is a outside view of abstraction.
Implementation :- Implementation is a inside view of abstraction.
The interface of the class is divided into following 4 parts
i. Public :- A declaration that is accessible to all clients.
ii. Protected :- A declaration that is accessible only to the class itself and its
subclass.
iii. Private :- A declaration that is accessible only to class itself.
iv. Package :- a declaration that is accessible only by classes in the same
package.
@2020 Presented By Y. N. D. Aravind
9
9
The Nature of Classes
There are THREE basic kinds of class relationships.
1) Association : which denotes semantics dependency among unrelated classes. The
symbol for association is
2) Generalization / specification ,denotes „is – a‟ relationship .
The symbol for generalization is
3) Aggregation / whole / part of relationship.
The symbol for aggregation is
Association :- The identification of association among classes is
describing how many classes / objects are taking part in relationship.
Multiplicity/Cardinality :- The multiplicity denotes the cardinality of
the association. There are three common kinds of multiplicity across an
association.
a. One – to – One
b. One – to – Many
c. Many – to - Many
@2020 Presented By Y. N. D. Aravind
10
10
Relationship among Classes
Inheritance:- Inheritance exists to express a generalization/specification
relationships. It is a relationship among classes where in one class shares
the structure and /or behavior defined in one or more other classes.
Inheritance means that subclass inherit the structure of their superclass.
Single Inheritance :- The single inheritance relationships deriving from
the super class. Each directed line denotes an „is - a‟ relationship.
Multiple Inheritance :- The multiple inheritance illustrates a class
structure.
Polymorphism :- It is a concept in type theory where in a name may
denote instances of many different classes as long as they are related by
common superclass. It is an operation can be implemented differently by
the classes in the hierarchy.
@2020 Presented By Y. N. D. Aravind 11
Relationship among Classes
Aggregation :- Aggregation relationship which provides the whole/put relationship
manifested in the class instances.
Aggregation relationships among classes have a direct parallel to aggregation
relationships among the objects corresponding to these classes.
1) Physical containment :- The life time of two objects are intimately connected.
2) Using :- „Using‟ shows a relationship between classes in which one class uses certain
services of another class in a variety of ways. „Using‟ relationship is equivalent to an
association.
3) Installation :- The process of creating a new object is referred to as instantiation
4) Genericity :- The possibility for a language to provided parameterized modules or
types. These are four basic ways of genericity.
a. Use of macros
b. Building heterogeneous class.
c. Using parameterized class must be instantiated before objects can be created .
d. By building generalized container classes which are strongly supported inheritance
but don‟t support any form of parameterized class.
5) Meta class :- Meta class is a class whose instances are themselves classes. It is used to
provide class variables and operations for initializing class variables and for creating the
meta classes single instance.
@2020 Presented By Y. N. D. Aravind 12
Relationship among Classes
.
@2020 Presented By Y. N. D. Aravind 13
Class Diagram for Library Management
Classes and objects are separate yet intimately related concepts .Specially, every
object is the instance of some class, and every class has zero or more instances.
• Class of most objects is static.
• Objects are typically created and destroyed at a rapid rate during lifetime
of an application.
Example :- Air Traffic Control system Planes, flight plans , runways and
airspaces
@2020 Presented By Y. N. D. Aravind 14
Interplay of Classes and Objects
Classical and modern approaches. There are three general approaches to
classification:
1) Classical Categorization:-
All the entities that have a given property or collection of properties in common
forms a category .
In certain criteria sameness among objects specifically one can divide objects
into disjoint sets depending upon the presence or absence of a particular property.
2) Conceptual Clustering:-
In this approach classes are generated by first formulating . Conceptual
description of classes and then classifying the entities according to the
descriptions.
3) Prototype Theory:-
In prototype theory, group things according to the degree of their relationship to
conduct prototypes.
@2020 Presented By Y. N. D. Aravind 15
Identifying Classes and Objects
Object Oriented Analysis :-
In Analysis, we try to discover the classes and objects that comprise the
vocabulary of the problem domain. A number of approaches have been used in
carrying out this task.
Classical Approaches:-
It is one of approach for analysis which derive primarily from the principles of
classical categorization.
 tangible things, roles, events , and interactions
• From the perspective of data base modeling
 people, places, things, organization, concepts, and events
• Another set of sources of potential objects
 structure, events remembered, roles played, locations, organizational units
@2020 Presented By Y. N. D. Aravind 16
Identifying Classes and Objects
Behavioral Analysis :- Classes based on groups of objects that exhibit similar
behavior.
Domain Analysis :- It is to identify the classes and objects that are domain to
all applications within a given domain.
Use case Analysis:- It is used to identify the objects that participate in the
scenario , responsibilities of each object and objects collaborate with other
objects in terms of operations.
CRC Cards (Class –Responsibilities/Collaborations):-
It is a tool that facilities training and enhance communication among developer
upon which analysis with the name of class , its responsibilities and its
collaborators one card is created for each class identified as relevant to the
scenario. CRC cards are arranged to represent generalization / specification or
aggregation hierarchies among the classes.
Structured Analysis :- Structured analysis is a technique that has been used to
develop programs using concepts of structured programming,
which, as we have previously noted has a procedural basis.
@2020 Presented By Y. N. D. Aravind 17
Identifying Classes and Objects
.
@2020 Presented By Y. N. D. Aravind 18
Importance of Proper Classification
1) Finding key abstraction – Primary values
2) Refining key abstraction
Promotion
grainsize conflict
 Naming conventions are as follows :-
 Object :- Proper Noun.
 Class :- Common Noun.
 Modifier :- Active Work.
 Sector :- Work in the form of “to be”.
Identifying Mechanism
Mechanism:- It is a process of designing patterns of a behavior
1) Mechanical Linkage
2) Electronic Linkage
3) No Linkage
@2020 Presented By Y. N. D. Aravind 19
Key Abstraction and Mechanism
Thank You
@2020 Presented By Y. N. D. Aravind
Presented By
Y. N. D. ARAVIND
M.Tech, Dept of CSE
Newton’s Group Of Institutions, Macherla
20

More Related Content

What's hot (20)

Threads in JAVA
Threads in JAVAThreads in JAVA
Threads in JAVA
 
Major and Minor Elements of Object Model
Major and Minor Elements of Object ModelMajor and Minor Elements of Object Model
Major and Minor Elements of Object Model
 
Java constructors
Java constructorsJava constructors
Java constructors
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
 
Class diagrams
Class diagramsClass diagrams
Class diagrams
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
 
Ooad
OoadOoad
Ooad
 
Uml class-diagram
Uml class-diagramUml class-diagram
Uml class-diagram
 
CS8592 Object Oriented Analysis & Design - UNIT I
CS8592 Object Oriented Analysis & Design - UNIT ICS8592 Object Oriented Analysis & Design - UNIT I
CS8592 Object Oriented Analysis & Design - UNIT I
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
Object model
Object modelObject model
Object model
 
Association agggregation and composition
Association agggregation and compositionAssociation agggregation and composition
Association agggregation and composition
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
 
[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP
 
[OOP - Lec 08] Encapsulation (Information Hiding)
[OOP - Lec 08] Encapsulation (Information Hiding)[OOP - Lec 08] Encapsulation (Information Hiding)
[OOP - Lec 08] Encapsulation (Information Hiding)
 
C# Delegates
C# DelegatesC# Delegates
C# Delegates
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Chapter 05 classes and objects
Chapter 05 classes and objectsChapter 05 classes and objects
Chapter 05 classes and objects
 
09 package diagram
09 package diagram09 package diagram
09 package diagram
 

Similar to Classes and Objects

Object oriented analysis and design using uml classes and objects
Object oriented analysis and  design using uml  classes and objectsObject oriented analysis and  design using uml  classes and objects
Object oriented analysis and design using uml classes and objectsLikhithaMadddula
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UMLyndaravind
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented PrinciplesEmprovise
 
Object-Oriented Analysis and Design
Object-Oriented Analysis and DesignObject-Oriented Analysis and Design
Object-Oriented Analysis and DesignIJOAEM
 
Bt8901 objective oriented systems1
Bt8901 objective oriented systems1Bt8901 objective oriented systems1
Bt8901 objective oriented systems1Techglyphs
 
A&D - Object Oriented Design using UML
A&D - Object Oriented Design using UMLA&D - Object Oriented Design using UML
A&D - Object Oriented Design using UMLvinay arora
 
Design Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityDesign Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityShubham Narkhede
 
Lecture 13
Lecture 13Lecture 13
Lecture 13Rana Ali
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming conceptPina Parmar
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programmingmustafa sarac
 
Ooad notes
Ooad notesOoad notes
Ooad notesNancyJP
 
PROPERTIES OF RELATIONSHIPS AMONG OBJECTS IN OBJECT-ORIENTED SOFTWARE DESIGN
PROPERTIES OF RELATIONSHIPS AMONG OBJECTS IN OBJECT-ORIENTED SOFTWARE DESIGNPROPERTIES OF RELATIONSHIPS AMONG OBJECTS IN OBJECT-ORIENTED SOFTWARE DESIGN
PROPERTIES OF RELATIONSHIPS AMONG OBJECTS IN OBJECT-ORIENTED SOFTWARE DESIGNijpla
 
Abap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorialsAbap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorialscesarmendez78
 

Similar to Classes and Objects (20)

Object oriented analysis and design using uml classes and objects
Object oriented analysis and  design using uml  classes and objectsObject oriented analysis and  design using uml  classes and objects
Object oriented analysis and design using uml classes and objects
 
Ooad 2
Ooad 2Ooad 2
Ooad 2
 
Ooad
OoadOoad
Ooad
 
Ooad
OoadOoad
Ooad
 
Oos Short Q N
Oos Short Q NOos Short Q N
Oos Short Q N
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented Principles
 
OOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptxOOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptx
 
Object-Oriented Analysis and Design
Object-Oriented Analysis and DesignObject-Oriented Analysis and Design
Object-Oriented Analysis and Design
 
Bt8901 objective oriented systems1
Bt8901 objective oriented systems1Bt8901 objective oriented systems1
Bt8901 objective oriented systems1
 
A&D - Object Oriented Design using UML
A&D - Object Oriented Design using UMLA&D - Object Oriented Design using UML
A&D - Object Oriented Design using UML
 
Design Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur UniversityDesign Pattern Notes: Nagpur University
Design Pattern Notes: Nagpur University
 
01. design pattern
01. design pattern01. design pattern
01. design pattern
 
Lecture 13
Lecture 13Lecture 13
Lecture 13
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming concept
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Ooad notes
Ooad notesOoad notes
Ooad notes
 
PROPERTIES OF RELATIONSHIPS AMONG OBJECTS IN OBJECT-ORIENTED SOFTWARE DESIGN
PROPERTIES OF RELATIONSHIPS AMONG OBJECTS IN OBJECT-ORIENTED SOFTWARE DESIGNPROPERTIES OF RELATIONSHIPS AMONG OBJECTS IN OBJECT-ORIENTED SOFTWARE DESIGN
PROPERTIES OF RELATIONSHIPS AMONG OBJECTS IN OBJECT-ORIENTED SOFTWARE DESIGN
 
Abap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorialsAbap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorials
 
Encapsulation
EncapsulationEncapsulation
Encapsulation
 

More from yndaravind

Repetations in C
Repetations in CRepetations in C
Repetations in Cyndaravind
 
Selection & Making Decisions in c
Selection & Making Decisions in cSelection & Making Decisions in c
Selection & Making Decisions in cyndaravind
 
Bitwise Operators in C
Bitwise Operators in CBitwise Operators in C
Bitwise Operators in Cyndaravind
 
Structure In C
Structure In CStructure In C
Structure In Cyndaravind
 
Fnctions part2
Fnctions part2Fnctions part2
Fnctions part2yndaravind
 
Functions part1
Functions part1Functions part1
Functions part1yndaravind
 

More from yndaravind (11)

OOAD
OOADOOAD
OOAD
 
FILES IN C
FILES IN CFILES IN C
FILES IN C
 
Repetations in C
Repetations in CRepetations in C
Repetations in C
 
Selection & Making Decisions in c
Selection & Making Decisions in cSelection & Making Decisions in c
Selection & Making Decisions in c
 
Bitwise Operators in C
Bitwise Operators in CBitwise Operators in C
Bitwise Operators in C
 
Structure In C
Structure In CStructure In C
Structure In C
 
Strings part2
Strings part2Strings part2
Strings part2
 
Arrays In C
Arrays In CArrays In C
Arrays In C
 
Strings IN C
Strings IN CStrings IN C
Strings IN C
 
Fnctions part2
Fnctions part2Fnctions part2
Fnctions part2
 
Functions part1
Functions part1Functions part1
Functions part1
 

Recently uploaded

MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 

Recently uploaded (20)

MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 

Classes and Objects

  • 1. @2020 Presented By Y. N. D. Aravind 1 Presented By Y. N. D. ARAVIND M.Tech, Dept of CSE Newton’s Group Of Institutions, Macherla
  • 2. @2020 Presented By Y. N. D. Aravind Chapter 3 Classes and Objects 3 2.1 The Natue of Objects 4 2.2 Relationships among Object 7 2.3 The Natue of Classes 10 2.4 Relationships among Classes 11 2.5 Interplay of Classes and Objects 14 2.6 Identifying Classes and Objects 15 2.7 Importance of Proper Classification 18 2.8 Key abstractions and Mechanism 19 2
  • 3. When we use object-oriented methods to analyze or design a complex software system, our basic building blocks are classes and objects. An object is an abstraction of something in a problem domain, reflecting the capabilities of a system to keep information about it, interact with it, or both  Objects have an internal state that is recorded in a set of attributes.  Objects have a behavior that is expressed in terms of operations. The execution of operations changes the state of the object and/or stimulates the execution of operations in other objects.  Objects (at least in the analysis phase) have an origin in a real world entity. Classes represent groups of objects which have the same behavior and information structures.  Every object is an instance of a single class  Class is a kind of type, an ADT (but with data), or an 'entity' (but with methods)  Classes are the same in both analysis and design  A class defines the possible behaviors and the information structure of all its object instances. @2020 Presented By Y. N. D. Aravind 3 CLASSES AND OBJECTS
  • 4. An object is any of the following: 1. Tangible , and /or visible thing. 2. Object represents an individual , identifiable item, entity either real world or abstract with a well defined role in the problem domain. 3. Object has state , behavior and identity , the structure and behavior similar objects are defined on their common class , the terms instance and object are interchangeable.. State :- The state of an object encompasses all of the properties of the object plus the dynamic values of each of these properties. A property is a distinctive characteristics that contributes to making an object uniquely that object properties are usually static because attributes such as these are unchanging and fundamental to the nature of an object. Behavior :- How an object acts and reacts , in terms of its state changeable state of object affect its behavior. @2020 Presented By Y. N. D. Aravind 4 4 The Nature of Object’s Static + Dynamic
  • 5. Operations :- Denotes a service that a class offers to its clients. These are 5 kinds off operations. 1) Modifier – Alters state of an object. 2) Selector – Access state of an object. 3) Iterator – Permits access to all parts of object in defined order. 4) Constructor – Creates object and initialize its state. 5) Destructor – Frees or destroys state of object itself. Identity :- Property of an object which distinguishes it from all other objects. Object Life Span :- The Life line of an object extends from the time it is first created until that space is recalled. Roles and Responsibilities Role :- Role is a mask that an object wears and defines a contract between an abstraction and its clients. Responsibilities :- Purpose of object and its place in system. @2020 Presented By Y. N. D. Aravind 5 5 The Nature of Object’s
  • 6. Object as Machine :- The existence of state within an object means that the order in which operations are invoked into two types „Active‟ and „Passive‟. @2020 Presented By Y. N. D. Aravind 6 6 The Nature of Object’s
  • 7. Two kinds of objects relationships 1) Links 2) Aggregation 1) Links :- Specific Association through which one object applies services of another object. As a participation in a link , an object may play one of three roles. a. Controller – Operates another object. b. Server – Operated by another object. c. Proxy – Both operates and operated by objects. Visibility:- It consists of four ways a. Globally declared b. Locally declared c. Part of a client object d. Programming object Synchronization:- One object passes message to another object across a link. It consists of three approaches. a. Sequential b. Guarded c. Concurrency @2020 Presented By Y. N. D. Aravind 7 7 Relationship among Object’s
  • 8. 2) Aggregation :- Aggregation is a special kind of Association . It may or may not denote physical containment whole / part of hierarchy. @2020 Presented By Y. N. D. Aravind 8 8 Relationship among Object’s
  • 9. Class is a set of object that share a common behavior and common semantics. Interface and Implementation:- Interface :- Interface is a outside view of abstraction. Implementation :- Implementation is a inside view of abstraction. The interface of the class is divided into following 4 parts i. Public :- A declaration that is accessible to all clients. ii. Protected :- A declaration that is accessible only to the class itself and its subclass. iii. Private :- A declaration that is accessible only to class itself. iv. Package :- a declaration that is accessible only by classes in the same package. @2020 Presented By Y. N. D. Aravind 9 9 The Nature of Classes
  • 10. There are THREE basic kinds of class relationships. 1) Association : which denotes semantics dependency among unrelated classes. The symbol for association is 2) Generalization / specification ,denotes „is – a‟ relationship . The symbol for generalization is 3) Aggregation / whole / part of relationship. The symbol for aggregation is Association :- The identification of association among classes is describing how many classes / objects are taking part in relationship. Multiplicity/Cardinality :- The multiplicity denotes the cardinality of the association. There are three common kinds of multiplicity across an association. a. One – to – One b. One – to – Many c. Many – to - Many @2020 Presented By Y. N. D. Aravind 10 10 Relationship among Classes
  • 11. Inheritance:- Inheritance exists to express a generalization/specification relationships. It is a relationship among classes where in one class shares the structure and /or behavior defined in one or more other classes. Inheritance means that subclass inherit the structure of their superclass. Single Inheritance :- The single inheritance relationships deriving from the super class. Each directed line denotes an „is - a‟ relationship. Multiple Inheritance :- The multiple inheritance illustrates a class structure. Polymorphism :- It is a concept in type theory where in a name may denote instances of many different classes as long as they are related by common superclass. It is an operation can be implemented differently by the classes in the hierarchy. @2020 Presented By Y. N. D. Aravind 11 Relationship among Classes
  • 12. Aggregation :- Aggregation relationship which provides the whole/put relationship manifested in the class instances. Aggregation relationships among classes have a direct parallel to aggregation relationships among the objects corresponding to these classes. 1) Physical containment :- The life time of two objects are intimately connected. 2) Using :- „Using‟ shows a relationship between classes in which one class uses certain services of another class in a variety of ways. „Using‟ relationship is equivalent to an association. 3) Installation :- The process of creating a new object is referred to as instantiation 4) Genericity :- The possibility for a language to provided parameterized modules or types. These are four basic ways of genericity. a. Use of macros b. Building heterogeneous class. c. Using parameterized class must be instantiated before objects can be created . d. By building generalized container classes which are strongly supported inheritance but don‟t support any form of parameterized class. 5) Meta class :- Meta class is a class whose instances are themselves classes. It is used to provide class variables and operations for initializing class variables and for creating the meta classes single instance. @2020 Presented By Y. N. D. Aravind 12 Relationship among Classes
  • 13. . @2020 Presented By Y. N. D. Aravind 13 Class Diagram for Library Management
  • 14. Classes and objects are separate yet intimately related concepts .Specially, every object is the instance of some class, and every class has zero or more instances. • Class of most objects is static. • Objects are typically created and destroyed at a rapid rate during lifetime of an application. Example :- Air Traffic Control system Planes, flight plans , runways and airspaces @2020 Presented By Y. N. D. Aravind 14 Interplay of Classes and Objects
  • 15. Classical and modern approaches. There are three general approaches to classification: 1) Classical Categorization:- All the entities that have a given property or collection of properties in common forms a category . In certain criteria sameness among objects specifically one can divide objects into disjoint sets depending upon the presence or absence of a particular property. 2) Conceptual Clustering:- In this approach classes are generated by first formulating . Conceptual description of classes and then classifying the entities according to the descriptions. 3) Prototype Theory:- In prototype theory, group things according to the degree of their relationship to conduct prototypes. @2020 Presented By Y. N. D. Aravind 15 Identifying Classes and Objects
  • 16. Object Oriented Analysis :- In Analysis, we try to discover the classes and objects that comprise the vocabulary of the problem domain. A number of approaches have been used in carrying out this task. Classical Approaches:- It is one of approach for analysis which derive primarily from the principles of classical categorization.  tangible things, roles, events , and interactions • From the perspective of data base modeling  people, places, things, organization, concepts, and events • Another set of sources of potential objects  structure, events remembered, roles played, locations, organizational units @2020 Presented By Y. N. D. Aravind 16 Identifying Classes and Objects
  • 17. Behavioral Analysis :- Classes based on groups of objects that exhibit similar behavior. Domain Analysis :- It is to identify the classes and objects that are domain to all applications within a given domain. Use case Analysis:- It is used to identify the objects that participate in the scenario , responsibilities of each object and objects collaborate with other objects in terms of operations. CRC Cards (Class –Responsibilities/Collaborations):- It is a tool that facilities training and enhance communication among developer upon which analysis with the name of class , its responsibilities and its collaborators one card is created for each class identified as relevant to the scenario. CRC cards are arranged to represent generalization / specification or aggregation hierarchies among the classes. Structured Analysis :- Structured analysis is a technique that has been used to develop programs using concepts of structured programming, which, as we have previously noted has a procedural basis. @2020 Presented By Y. N. D. Aravind 17 Identifying Classes and Objects
  • 18. . @2020 Presented By Y. N. D. Aravind 18 Importance of Proper Classification
  • 19. 1) Finding key abstraction – Primary values 2) Refining key abstraction Promotion grainsize conflict  Naming conventions are as follows :-  Object :- Proper Noun.  Class :- Common Noun.  Modifier :- Active Work.  Sector :- Work in the form of “to be”. Identifying Mechanism Mechanism:- It is a process of designing patterns of a behavior 1) Mechanical Linkage 2) Electronic Linkage 3) No Linkage @2020 Presented By Y. N. D. Aravind 19 Key Abstraction and Mechanism
  • 20. Thank You @2020 Presented By Y. N. D. Aravind Presented By Y. N. D. ARAVIND M.Tech, Dept of CSE Newton’s Group Of Institutions, Macherla 20