| | Analysis | Requirements & Principles |
architecture: Paradigms |
substance: Abstractions |
structure: Domains | building blocks: Features |
surface: Syntactics | Defining PLs |
Language List | |||||
| foundational | safety |
flexibilized
| ||||||||||||
[CoAlg] Horst Reichel: An Approach to Object Semantics based on Terminal Co-algebras; Math Struct in Comp Sci (1993/11).
[DT/PD] Pg 13/14,21 in John C Reynolds:
User-Defined Types and Procedural Data Structures as Complementary Approaches to Data Abstraction; In [TAOOP] (first 1975).
[TCACI] Bart Jacobs and Jan Rutten: A Tutorial on (Co)Algebras and (Co)Induction; 1997.
[OCCoa] Bart Jacobs: Objects and classes, co-algebraically; In: Object-Orientation with Parallelism and Persistence; Kluwer 1996.
[OO/AD] William R Cook: Object-Oriented Programming Versus Abstract Data Types. In: Foundations of Object-Oriented Languages; Springer, 1991.
[OOPUA] Guiseppe Castagna: Object-Oriented Programming: A Unified Approach; Birkhäuser, 1997.
[PBL] Christophe Dony, Jacques Malenfant, Pierre Cointe: Prototype-Based Languages: From a New Taxonomy to Constructive Proposals and Their Validation; OOPSLA'92.
[ThO] Martin Abadi, Luca Cardelli: A Theory of Objects; Springer 1996.
[WOMB] Ole Lehrmann Madsen, Birger M\/oller-Pedersen: What object-oriented programming may be - and what it does not have to be; ECOOP'88.
| Abstraction | Examples | Techniques of Support |
|---|---|---|
|
1. aggreggation / |
|
|
|
2. classification / |
|
|
|
3. generalization / |
|
|
| Additionally, in programing languages one also says "abstraction" to parameterization, which does not seem to fit into this classification of abstractions (it contains aspects of each of them), and might therefore be considered a fourth subfunction of abstraction: | ||
| 4. parameterization |
| |
x denotes the term E.
Therefore, E is evaluated each time that x is used in the execution of P or G, resp.
That is, execution follows the
normal evaluation strategy aka lazy aka, in case of parameterization, call-by-name [<].
x denotes the value v to which E evaluates.
Therefore, E is evaluated
when, resp., the definition x=E or the application G(E) are evaluated;
x is then bound to the resulting value v.
int &x = E and void f(int &x) { ... }
«Sie [die Prozedur] ermöglicht es dem Programmierer, eine Folge von Aktionen als eine einzige Aktion zu betrachten und die Wechselwirkunge dieser Aktionen mit anderen Teilen des Programms zu kontrollieren.» [Louden 11].
As soon as we start working in an untyped universe, we begin to organize it in different ways for different purposes. Types arise informally in any domain to categorize objects according to their usage and behavior. The classification of objects in terms of the purposes for which they are used eventually results in a more or less well-defined type system. Types arise naturally, even starting from untyped universes» [UTDAP].
The term "type" is used in several combinations with other words and used with different meanings. (mathematical concept of types). An incomplete overview:
Data Abstraction
<< abstract >>
A
|
.------------------------+------------------------.
| | |
Data Type Abstraction Object Abstraction 2-D Data Abstraction
(abstract data types) (object-based OO)
has dynamic dispatch
A A A A
: | | |
: `-----. .-----' `------. + cloning
: + dyn overload| | + generators |
: (+ receiver | | (+ method |
: syntax) | | suites) |
: | | Prototype-based
: Class Instances (e.g. actor systems?)
: A A
: | |
: | | + delegation
: ``classical OO'' |
: Delegation-based
:................................. (with traits)
``Data Abstraction refers to a range of techniques for defining and manipulating data in an abstract fashion.'' [OO/AD, 155]
Besides general data abstract,
abstract data types and object abstractions
are ``two distinct techniques for implementing abstract data''
[OO/AD, 152].
There is a ``duality [in the categorial sense]
between abstract object types on the one hand
and abstract data types on the other hand'' [CoAlg, 4]:
``Whereas abstract data types in the initial approach may be formalized
as minimal soulutions (fixed points) of recursive type equations,
object types may be understood
as maximal solutions (fixed points) of recursive type equations'' [CoAlg, 2].
More generally:
``The distinction between algebra and coalgebra pervades computer science
and has been recognized by many people in many situations,
usually in terms of data versus machines.
A modern, mathematical precise way to express the difference is in terms of algebras and coalgebras.
The basic dichotomy may be described as construction versus observation'' [TCACI, 4].
``The initial algebras and terminal coalgebras ... can be described in a canonical way:
an initial algebra can be obtained from the closed terms
(i.e. from those terms which are generated by iteratively appluing the algebra's constructor operations),
and the terminal coalgebra can be obtained from the pure observations'' [TCACI, 3].
signature Complex = opaque C make : Real x Real -> C re,im : C -> Real mul : C x C -> C |
| Abstract Data Types: | Object Abstraction: |
| Pro: ``[I]t is possible to improve the efficiency, because the representations of both arguments to the [observation operation] may be inspected'' [OO/AD, 166]. |
Con: ``[A] primitive operation can have access to the representation
of only [the] data item ... of which the operation is a component''
[DT/PD].
Pro: ``[A]ddition of a specialized representation can also be viewed as a form of optimization'' [OO/AD, 166]. |
| Con: ``Adding a new constructor to an abstract data type involves extending its concrete representation. This, in turn, requires that all of the case statements on the operations be extended to cover the new representation variant'' [OO/AD, 162]. | Pro: ``[E]asier extensibility'' [DT/PD]: ``[T]he objects act as clients among themselves, and so are encapsulated from each other'' [OO/AD, 161]. Adding a new constructor for an existing object type ``is easy'' because ``[t]he representation is decentralized'' [OO/AD, 162]. |
| Con?: ``Adding new observations ... is complicated by the fact that the hidden representation must be shared by all operations. In some way the new observation operation must be inserted within the scope of the representation type'' [OO/AD, 165]. | Con: To add a new observation to an existing object type ``it is necessary to add it to each constructor'' [OO/AD, 165]. |
| An interface type I | = Signature I'
where the declared sort S is the sort of object states, and
where self is added as a by-reference parameter of sort S to all methods of I. |
| A class C implementing I | = Algebra A with signature I' |
| An object o, instance of C | = Variable o' with an S value operated upon by A's operations |
The class concept allows to extend each direction of data abstraction by aspects of the other one [OO/AD]:
| Abstract Data Types: | Object Abstraction: |
|
Sharing of representation among objects is achieved
by making the encapsulation of the representation class-based,
not object-based. Then object types are just
partially abstract interfaces [OO/AD, 170].
As a compromise with object-based encapsulation, parts of the representation might be object-wide and another part might be class-wide accessable. Example Eiffel: object-based ``export NONE'' and (sub)class-based ``export MyClass.'' |
«Delegation was introduced [by Lieberman 1981] as a message forwarding mechanism. The basic idea of delegation is to forward messages that cannot be handled by an object to another object called its parent in Self or proxy in Act1 ... Indeed, the key-point of delegation is that the pseudo-variable "self" still points to the original receiver of the message, even if the method used to answer the message is found in one of its parent[!]» [PBL, 203]
| | Analysis | Requirements & Principles | Paradigms | Abstractions | Domains | Features | foundational | safety | flexible typing | Syntactics | Defining PLs | Language List |