Title: Principles of ObjectOriented Software Development
1Principles of Object-Oriented Software Development
- Object-oriented programming languages
2Object-oriented programming languages
Introduction The object paradigm
Comparing Smalltalk, Eiffel, C and Java
Design dimensions of object-oriented languages
Prototypes -- delegation versus inheritance
Meta-level architectures Summary Q/A
Literature
3Object-orientedprogramming languages
- the object paradigm
- language design dimensions
- classless prototypes
- meta-level architectures
Additional keywords and phrases programming
languages, orthogonality, reliability,
complexity, types, delegation, multiple
paradigms, prototypes, reflection
4The object paradigm
Subsections A classification of
object-oriented languages Alternative object
models Object extensions of Lisp, C and
Prolog Script languages -- integration with
Java
5The notion of object
Simula
- abstract data types -- software engineering
- frames -- artificial intelligence
- semantic data models -- database system
development - capability-based computing -- distributed systems
6object-oriented
structurally capability of representing
arbitrarily structured complex objects operationa
lly the ability to operate on complex
objects through generic operators behaviorally
the specification of types and operations
(data abstraction)
Perspectives of object orientation
7A classification of object-oriented languages
8Objects
language characteristics
- object creation facility
- message passing capability
- class capability
- inheritance features
9Classification
- hybrid -- C, Lisp, Pascal, Prolog
- frame-based -- knowledge-based reasoning
- distributed, concurrent, actor -- parallel
computing - alternative object models -- prototypes,
delegation
10Alternative object models
11Object extensions of Lisp, C and Prolog
Object extensions Lisp -- LOOPS, FLAVORS,
CLOS, FOOPS C -- Objective C, C
Prolog -- SPOOL, VULCAN, DLP Commercial
products -- languages Smalltalk, Eiffel,
C, Objective C, Object Pascal, Java
12Object structure -- efficient mapping
C struct A ...
class A public ...
class A ... struct A private
The
equivalence between class and struct
13Script languages
Java embedding
Javascript -- Dynamic HTML Perl
-- CGI/Web library
JPL
Tcl/Tk -- tclets
Jacl, Tcl Blend
Python -- Grail
JPython
14Objects in Javascript
15 ltscript languageJavascriptgt
javascript
function object_display(msg)
object method
return msg ' (' this.variable ')'
function object()
object
constructor this.variable0
this.display object_display return
this var a new object()
create object document.write(a.display("a
message")) document.write(a.display("another
message")) lt/scriptgt
16Comparing Smalltalk, Eiffel, C and Java
Subsections Criteria for comparison
Language characteristics
17Criteria for comparison
- class libraries
- programming environment
- language characteristics
18Language characteristics
- uniformity of data structures
- documentation value
- reliability
- inheritance mechanisms
- efficiency
- memory management
- language complexity
19 Smalltalk
Eiffel C Java
uniformity high
medium low medium
documentation value medium high
medium high reliability
medium medium
low high protected operations
no no yes
yes multiple inheritance no
yes yes
no efficiency low
medium high
low garbage collection yes
yes no yes
language complexity low
medium high medium
20Design dimensions of object-oriented
languages
Subsections Object-based versus
object-oriented Towards and orthogonal
approach -- type extensions Multi-paradigms
languages -- logic Active objects --
synchronous Java/C
21Object Oriented LanguageDesign
- object state operations
- class template for object creation
- inheritance super/base and subclasses
object-oriented objects classes
inheritance
data abstraction -- state accessible by
operations strong typing -- compile time checking
22Orthogonal approach
- objects -- modular computing agents
- types -- expression classification
- delegation -- resource sharing
- abstraction -- interface specification
23Multi-paradigm languages
24Open systems reactive -- flexible (dynamic)
choice of actions modular -- (static)
scalability Dimensions of modularity
encapsulation boundary -- interface to client
distribution boundary -- visibility from within
objects concurrency boundary -- threads per
object, synchronization
25Active objects
26Object-based concurrency
- add processes -- synchronization
- multiple active objects -- rendezvous
- asynchronous communication -- message buffers
27Synchronous C/Java
28 active class S
sC public
m () ... private _at_S ()
pseudo-constructor select
01 -gt m()
external call
instructions ...
accept m
accept internal method instructions
... waituntil
(date)
time-out instructions ...
default
default instructions ...
29Prototypes
- delegation versus inheritance
Subsections Alternative forms of sharing
Implementation techniques -- Self
30Prototypes
exemplars
- cloning -- creation time sharing
- delegation -- lifetime sharing
31State slots -- parents, variables and
methods Creation shallow cloning deep
cloning Delegation implicit delegation
explicit delegation
32Improving performance
- special purpose hardware
- hybrid languages
- static typing
- dynamic compilation
Implementation techniques -- Self
33Self -- prototypes objects, cloning,
delegation Dynamic compilation -- type
information customized compilation
message inlining lazy compilation
message splitting
Implementation techniques -- Self
34Meta-level architectures
35The class concept
- abstract data type -- interface description
- object generator -- template for creation
- repository -- for sharing resources
- object -- instance of a metaclass
36(No Transcript)
37Postulates
class-based languages
- everything is an object
- every object belongs to a class
- every class inherits from the class Object
- class variables of an object are instance
variables of its class
38Reflective definition of Class
name Class supers
(Object) iv
(name supers iv methods) methods
(new ...)
39Summary
40The object paradigm
1
- notion of object -- viewpoints
- classification -- object extensions
41Comparing Smalltalk,Eiffel, C and Java
2
- criteria -- libraries, environments, language
characteristics - comparison -- language characteristics
42Design dimensions ofobject-oriented languages
3
- object-oriented -- object-based inheritance
- orthogonal dimensions -- objects, types,
delegation, abstraction - open systems -- dimensions of modularity
43Prototypes -- delegationversus inheritance
4
- prototypes -- cloning and delegation
- performance -- dynamic compilation
44Meta-level architectures
5
- class -- the concept of class
- meta architecture -- subclass and instance
hierarchy - reflection -- postulates
45Questions
1. What are the basic characteristics of
object-oriented languages? 2. How would you
classify object-oriented languages? Name a few
representatives of each category. 3. What do you
consider to be the major characteristic of the
object model supported by C? Explain. 4. Why
would you need friends? 5. How would you
characterize the difference between object-based
and object-oriented? 6. Along what orthogonal
dimensions would you design an object-oriented
language? Explain. 7. Give a characterisation of
active objects. In what situations may active
objects be advantageous? 8. How would you
characterize prototype-based languages?
469. What are the differences between inheritance
and delegation? Does C support delegation?
Explain. And Java? 10. How would you
characterize the concept of a class? 11. Can you
sketch the meta architecture of Smalltalk? 12.
How would you phrase the postulates underlying
class-based languages? Can you give a reflective
version of these postulates?
47Further reading
A concise treatment of programming languages is
given in BG94. Further, you may want to
consult Wegner87, which contains the original
presentation of the discussion concerning the
distinction between object-based and
object-oriented. For Java, read the original
white paper, Java. An interesting extension of
C is described in Petitpierre98. At the
corresponding web site, http//ltiwww.epfl.ch/sCxx
, there is much additional material. Finally,
for an account of the design and evolution of
C, read Stroustrup97. For more information on
C, visit http//www.accu.org , and for Java,
http//www.javasoft.com .