Unit_2.00000000000000000000000000000.pdf

pateltech13 15 views 23 slides Feb 20, 2025
Slide 1
Slide 1 of 23
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23

About This Presentation

oops pdf for study


Slide Content

A.D. PATEL INSTITUTE OF TECHNOLOGY
(A Constituent College of CVM University)
Subject: Object Oriented Programming(102000212)

Concepts of OOP

Contents /Topics to be covered
•Introduction OOP
•Procedural Vs. Object Oriented Programming
•Principles of OOP
•Benefits and applications of OOP

Introduction to OOP

Principles of OOP
•DATAABSTRACTION :
•Abstractionreferstotheactofrepresentingessentialfeatureswithout
includingthebackgrounddetailsorexplanations.
•Classesusetheconceptofabstractionandaredefinedassize,widthand
cost,andfunctionstooperateontheattributes.
•Theyencapsulatealltheessentialpropertiesoftheobjectsthataretobe
created.

Principles of OOP cont…
DATAENCAPSALATION :
Thewrappingupofdataandfunctionintoasingleunit(calledclass)is
knownasencapsulation.
•Thedataisnotaccessibletotheoutsideworldandonlythose
functionswhicharewrappedintheclasscanaccessit.
•Thesefunctionsprovidetheinterfacebetweentheobjectsdataand
theprogram.
•Theinsulationofthedatafromdirectaccessbytheprogramiscalled
datahidingorinformationhiding.

Principles of OOP cont…
INHERITANCE:
•Inheritanceistheprocessbywhichobjectsofoneclassacquirethe
propertiesofanotherclass.
•Intheconceptofinheritanceprovidestheideaofreusability.
•Thismeanthatwecanaddadditionalfeaturestoanexistingclasswithout
modifyingit.
•Thisispossiblebyderivinganewclassfromtheexistingone.
•Thenewclasswillhavethecombinedfeaturesofboththeclasses.

Inheritance Example:

Principles of OOP cont…
POLYMORPHISIM :
•Polymorphismmeanstheabilitytotakemorethanoneform.
•Anoperationmayexhibitdifferentinstance.
•Thebehaviordependsuponthetypeofdatausedintheoperation.
•Alanguagefeaturethatallowsafunctionoroperatortobegivenmore
thanonedefinition.
•Thetypesoftheargumentswithwhichthefunctionoroperatoriscalled
determineswhichdefinitionwillbeused.

Principles of OOP cont…
•Overloadingmaybeoperatoroverloadingorfunctionoverloading.
•Itisabletoexpresstheoperationofadditionbyasingleoperatorsay‘+’.
•Whenthisispossibleyouusetheexpressionx+ytodenotethesumofx
andy,formanydifferenttypesofxandy;integers,floatandcomplexno.
•Youcanevendefinethe+operationfortwostringstomeanthe
concatenationofthestring.

Polymorphism Example

Dynamic Binding & Static Binding
•Bindingreferstothelinkingofaprocedurecalltothecodetotheexecuted
inresponsetothecall.
•Dynamicbindingmeansthecodeassociatedwithagivenprocedurecall
isnotknownuntilthetimeofthecallatrun-time.
•StaticBindingdefinesthepropertiesofthevariablesatcompiletime.
Thereforetheycan’tbechanged.

Message passing
•Anobjectorientedprogramconsistsofasetofobjectsthatcommunicate
witheachother.
•Amessageforanobjectisarequestforexecutionofaprocedureand
thereforewillinvokeafunction(procedure)inthereceivingobjectthat
generatesthedesiredresult.
•Messagepassinginvolvesspecifyingthenameoftheobject,thenameof
thefunction(message)andinformationtobesent.

BENEFITS OF OOP:
1.Throughinheritancewecaneliminateredundantcodeandextendtheuse
ofexistingclasses.
2.Wecanbuildprogramsfromthestandardworkingmodulesthat
communicatewithoneanother,ratherthanhavingtostartwritingthecode
fromscratch.Thisleadstosavingofdevelopmenttimeandhigher
productivity.
3.Theprincipleofdatahidinghelpstheprogrammertobuildsecure
programsthatcan’tbeinvadedbycodeinotherpartsoftheprogram.

BENEFITS OF OOP: Cont…
4.Itispossibletohavemultipleinstancesofanobjecttoco-existwithout
anyinterference.
5.Itiseasytopartitiontheworkinaprojectbasedonobjects.
6.Object-orientedsystemscanbeeasilyupgradedfromsmalltolarge
systems.
7.Messagepassingtechniquesforcommunicationbetweenobjectsmakes
theinterfacedescriptionwithexternalsystemsmuchsimpler.
8.Softwarecomplexitycanbeeasilymanaged

Applications of OOP
•Real –Time systems.
•Simulation and modeling
•Object oriented databases.
•Hypertext, hypermedia and expertext.
•Al and expert systems.
•Neural networks and parallel programming.
•Decision support and office automation systems.
•CIM / CAM / CAD system.

Thank you
Tags