Upload
adil-raja
View
177
Download
4
Tags:
Embed Size (px)
Citation preview
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
AN INTRODUCTION TO OBJECT ORIENTED
PROGRAMMING (OOP)A COURSE OUTLINE
Muhammad Adil Raja
Roaming Researchers, Inc.
cbndMarch 31, 2015
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
OUTLINE I
1 INTRODUCTION
2 ABSTRACTION
3 OBJECT ORIENTED DESIGN
4 CLASSES AND METHODS
5 MESSAGES, INSTANCES AND INITIALIZATION
6 INHERITANCE AND SUBSTITUTION
7 SUBCLASSES AND SUBTYPES
8 STATIC AND DYNAMIC BEHAVIOR
9 IMPLICATIONS OF SUBSTITUTION
10 MULTIPLE INHERITANCE
11 POLYMORPHISM AND SOFTWARE REUSE
12 OVERLOADING
13 OVERRIDING
14 THE POLYMORPHIC VARIABLE
15 GENERICS
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
OUTLINE II
16 CONTAINER CLASSES
17 FRAMEWORKS
18 OBJECT INTERCONNECTIONS
19 DESIGN PETTERNS
20 REFLECTION AND INTROSPECTION
21 DISTRIBUTED OBJECTS
22 IMPLEMENTATION
23 REFERENCES
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
INTRODUCTION I
What is OOP?
Why is it popular?
Benefits of OOP.
Messages and methods.
Hierarchies and inheritance.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
ABSTRACTION I
Layers of abstraction.
Encapsulation and interchangeability.
Interface and Implementation.
Abstract data types.
Messages, inheritance and polymorphism.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
OBJECT ORIENTED DESIGN I
Components.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
CLASSES AND METHODS I
Encapsulation.Class definitions.C++, Java, and C-sharp.Methods.Constant and immutable data fields.Separating definition and implementation.Variations on Class themes.Methods without classes.Interfaces.Properties.Forward definitions.Inner or nested classes.Class data fields.Classes as objects.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
MESSAGES, INSTANCES AND INITIALIZATION I
Message-passing syntax.
Statically and dynamically typed languages.
Accessing the receiver from within method.
Object creation.
Creation of arrays of objects.
Pointers and memory allocation.
Memory recovery.
COnstructors.
The orthodox canonical class form.
Constant values.
Destructors and finalizers.
Metaclasses.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
INHERITANCE AND SUBSTITUTION I
An intuitive description of inheritance.
The is-a test.
Reasons to use inheritance.
Inheritance in various languages.
Subclass, subtype, and substitution.
Substitution and strong typing.
Overriding and virtual methods.
Interfaces and abstract classes.Forms of inheritance.
1 Subclassing for specialization (subtyping).2 Subclassing for specification.3 Subclassing for construction.4 Subclassing for generalization.5 Subclassing for extension.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
INHERITANCE AND SUBSTITUTION II
6 Subclassing for limitation.7 Subclassing for variance.8 Subclassing for combination.9 SUmmary.
Variations on inheritance.
Anonymous classes in Java.
Inheritance and constructors.
Virtual destructors.
The benefits of inheritance.
Virtual destructors.The benefits of inheritance.
1 Software reusability.2 Code sharing.3 Consistency of inheritance.4 Software components.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
INHERITANCE AND SUBSTITUTION III
5 Rapid prototyping.6 Polymorphism and frameworks.7 Information hiding.
The costs of inheritance.1 Execution speed.2 Program size.3 Message-passing overhead.4 Program complexity.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
SUBCLASSES AND SUBTYPES I
Substitutability.
Subtypes.
The substitutability paradox.
Subclassing for construction.
Dynamically typed languages.
Pre- and Postconditions.
Refinement semantics.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
STATIC AND DYNAMIC BEHAVIOR I
Static versus dynamic typing.
Static and dynamic classes.
Runtime type determination.
Down casting (reverse polymorphism).
Run-time testing without language support.
Testing message understanding.
Static versus dynamic method binding.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
IMPLICATIONS OF SUBSTITUTION I
Memory layout.
Minimum static space allocation.
Maximum static space allocation.
Dynamic memory allocation.
Assignment.
Assignment in C++
Copies and clones.
Copies in Smalltalk and Objective-C.
Copy constructors in C++.
Cloning in java.
Equality.
Equality and identity.
The paradoxes of equality testing.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
MULTIPLE INHERITANCE I
Inheritance as categorization.
Incomparable complex numbers.
Problems arising from multiple inheritance.
Name ambiguity.
Multiple inheritance of interfaces.
Inheritance from common ancestors.
Inner classes.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
POLYMORPHISM AND SOFTWARE REUSE I
Polymorphism in programming languages.
Mechanisms for software reuse.
Using composition.
Using inheritance.
Efficiency and polymorphism.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
OVERLOADING I
Type signatures and scopes.
Overloading based on scopes.
Overloading based on type signatures.
Redefinition.
Multi-methods.
Overloading based on values.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
OVERRIDING I
Notating overriding.
Replacement versus refinement.
Deferred methods.
Covariance and contravariance.
Variations in overriding.
FInal methods in java.
Versioning in C-sharp.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
THE POLYMORPHIC VARIABLE I
Simple polymorphic variables.
The receiver variable.
Downcasting.
Pure polymorphism.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
GENERICS I
Template functions.
Template classes.
Inheritance in template arguments.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
CONTAINER CLASSES I
Containers in dynamically types languages.
Containers in statically types languages.
Restricting element types.
Element traversal.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
FRAMEWORKS I
Reuse and specialization.
An upside-down abstractions.
Example frameworks.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
OBJECT INTERCONNECTIONS I
Coupling and cohesion.
Subclass clients and user clients.
Control of access and visibility.
Intentional dependency.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
DESIGN PATTERNS I
Controlling information flow.
Describing patterns.
Iterator.
Software factory.
Strategy.
Singleton.
Composite.
Decorator.
The double-dispatching pattern.
Flyweight.
Proxy.
Facade.
Observer.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
REFLECTION AND INTROSPECTION I
Mechanisms for understanding.
Methods as objects.
Mechanisms for for modification.
Metaclasses.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
DISTRIBUTED OBJECTS I
Addresses, ports and sockets.
A simple client/server program.
Multiple clients.
Transmitting objects over a network.
Providing more complexity.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
IMPLEMENTATION I
Compilers and interpreters.
The receiver as argument.
Inherited methods.
Overridden methods.
Name encoding.
Dispatch tables.
Bytecode interpreters.
Just-in-time compilation.
AnIntroduction
to ObjectOriented
Programming
MuhammadAdil Raja
Introduction
Abstraction
ObjectOrientedDesign
Classes andMethods
Messages,InstancesandInitialization
InheritanceandSubstitution
SubclassesandSubtypes
REFERENCES I
An Introduction to Object Oriented Programming,Timothy Budd.