Next: Efficiency
Up: What are our requirements for
Previous: Inheritance
We need a mechanism to enhance a given type.
For instance,
- to define the monoid of non-negative integers
we need the type MONOID and
- to define the exponentiation
(p, n) pn
when defining monoids, we need the set of non-negative integers
to be defined already.
The solution is to be able
- to define first the set of non-negative integers
without viewing it as a MONOID,
- then to define the interface MONOID
- and finally to enhance the concrete class of non-negative integers
by adding to it the property of being a MONOID.
Next: Efficiency
Up: What are our requirements for
Previous: Inheritance
Marc Moreno Maza
2003-06-06