Object-Oriented Programming An Overview

piteousnessbutterΛογισμικό & κατασκευή λογ/κού

14 Ιουλ 2012 (πριν από 5 χρόνια και 9 μέρες)

365 εμφανίσεις

'
&
$
%
Object-OrientedProgramming
AnOverview
OOP-1
'
&
$
%
Contents
²OOPandsoftwareproductivity
²FeaturesandcharacteristicsofOOP
²MajorconceptsofOOP
²OOPlanguages
²OOPandtraditionaldesign
²Advantagesanddisadvantages
OOP-2
'
&
$
%
WhatisObject-OrientedProgramming
²Awell-regardedandwidelyacceptedprogrammingtechnology
²Potentialformuchimprovedproductivity
²Usesinteractingprogramobjects
²Objectsareindependententities
²Objectsrespondtomessages
OOP-3
'
&
$
%
SoftwareProductivityFactors
²Modularity(separationofduties)
²Extensibility(responsivetofuturerequirements)
²Modifiability(easytomakesmallchanges)
²Flexibility(notcastinconcrete)
²Maintainability(bigsavings)
²Reusability(don’treinventthewheel)
OOP-4
'
&
$
%
SoftwareEngineeringTechniques
²Dataabstraction(hiddendatarepresentation)
²Programencapsulation(operationsmarriedtodata)
²Softwarelibraries(fixedreusable)
²ReusableObjects(flexible,reusable)
²Polymorphism(type-relatedgenericoperations)
²Maintenanceautomation
OOP-5
'
&
$
%
OOPCentralConcepts
²Dataabstraction
²Encapsulation
²Classification
²Inheritance
²Polymorphism
OOP-6
'
&
$
%
OOPCharacteristics
²Classdefinitions
²Inheritanceandclasshierarchy
²OperatorandFunctionoverloading
²Genericclasses
²Classlibraries
OOP-7
'
&
$
%
OOPLanguages
²Simula
²Modula
²Smalltalk
²Ada
²Objective-C
²CLOS(CommonLispObjectStandard)
²StandardC++
²Java
²Scriptinglanguages:Perl,Javascript,Python
OOP-8
'
&
$
%
Traditionalvs.OOP
²ProceduralProgramming:
datastructures+algorithms=Program
²OOP:
objects+messages=Program
OOP-9
'
&
$
%
ClassDefinition
²BlueprintforbuildingObjects
²Members:methodsandfields
²privateandpublic
²API—applicationprogramminginterface
²relationwithotherclasses
OOP-10
'
&
$
%
AnObject
Internal
working
interface
Public
Method
call
OOP-11
'
&
$
%
InheritanceExample
EngineSteeringBreaksDoorsWheelsTires
Auto
Sedan
2−4 Doors4 WheelsRadioTrunk
Inherits
OOP-12
'
&
$
%
InheritanceExample
Sedan
2−4 Doors4 WheelsRadioTrunk
Inherits
4 Doors
Family SedanACAutomaticBig TrunkFuel Economy
OOP-13
'
&
$
%
InheritanceExample
Sedan
2−4 Doors4 WheelsRadioTrunk
Inherits
2 DoorsACManualTiny TrunkHorse power
Sports SedanHigh Price
OOP-14
'
&
$
%
InheritanceConcepts
²Derivingnewclassesfromoldones
²Singleinheritance
²Partialinheritance
²Multipleinheritance
²Inheritancechain
OOP-15
'
&
$
%
GenericClasses
²Classdefinitionforunspecifieddata
²Containerclass
²Flexibleandreusable
OOP-16
'
&
$
%
ReusabilityConsiderations
²Pipes/filter(alaUNIX):slow,restrictive
²Subroutinelibraries:fast,inflexible
²Objectlibraries:flexible,andefficient
OOP-17
'
&
$
%
DesignApproaches
²WaystoBreakTheProblemDown
²Proceduraldecomposition
²Datadecomposition
²Object-orienteddecomposition
OOP-18
'
&
$
%
ProceduralDecomposition
²Alsoknownasfunctionalortraditionaldesign
²Decomposethesolutionintomajorsteps
²Decomposeeachmajorstepfurther
²Decompositionprocedural-oriented
OOP-19
'
&
$
%
TraditionalDesignDisadvantages
²Dataandoperationsareseparated
²Nodataabstractionorinfohiding
²Notresponsivetochangesinproblemspace
²Inadequateforconcurrentproblems
OOP-20
'
&
$
%
Object-orientedDesignPrinciple
²Identifyinteractingobjects
²Characterizeeachobject,establishattributes
²Identifythedataandoperationswithineachobject
²Identifyrequestsansweredbyeachobject
²Identityservicesrequiredofotherobjects
²Establishrelationshipstootherobjects
²Groupsimilarobjectstogether
²Implementcommonsuperclasses
²Implementdifferentobjectsasclasses
OOP-21
'
&
$
%
Advantages
²Responsivetochanges
²Encapsulation
²SimplifyTesting,debugging
²Easytounderstand
²Avoidreinventingthewheel
²Easiertomanage,tomaintain
²Off-the-shelfsoftware
OOP-22
'
&
$
%
PotentialDisadvantages
²Overgeneralization
²Artificialclassrelations
²Unnecessarycomplications
OOP-23