Objectives
This section raises the issue of abstraction
in modeling and programming.
It describes by what mathematical means we may model
the meaning of abstract data types
and introduces the notion of types as constraints.
Further, it reflects on the objectives of typed
object-oriented programming.
Points to emphasize
- abstraction -- control and data
- abstract data types -- values in a semantic domain
- types as constraints -- mathematical models
Hints
The notion of types as constraints allows for
developing increasingly complex mathematical models,
capturing syntactical and behavioral properties.
It is important to stress that constraints may be expressed
in a variety of ways: as equational theories,
as higher order types or as logical formulas.
Questions
- Characterize the differences between control
abstractions and data abstractions.
Explain how these two kinds of abstractions
may be embodied in programming language constructs.
- How can you model the meaning of abstract data types
in a mathematical way?
Do you know any alternative ways?
- Explain how types may affect object-oriented programming.
Comments
Whether one believes in types for OOP or not
depends to a certain extent upon ones preferences.
Discuss your preferences and explain what trade-offs
are involved in the choice for typed versus untyped OOP.