Re: Separation of API and implementation
- From: "Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx>
- Date: Thu, 16 Aug 2007 09:46:31 +0200
On Wed, 15 Aug 2007 17:11:27 -0400, Daniel T. wrote:
If a particular sub-class of X will only work with a particular subclass
of Y, then this needs to be made explicit in the code. Note, even a
double dispatch system doesn't help if it is an error to connect certain
Xs with certain Ys.
Yes, it is not enough to have MD alone. To detect wrong combinations
statically is a problem. I think we need fresh ideas regarding types
algebra. Presently we have only sets of types (classes) constrained to a
given type (instance). In a parallel hierarchy there is a set of pairs of
types and the constraint is put on the pair.
Maybe the pair of types in foo should be treated as some helper type
forming its own class of pairs (X,Y). Deriving from X should imply an
implicit deriving from the pair (X,Y) and thus require a derivation from Y,
or else an explicit confirmation that old Y is allowed as a member of new
pair. Then for this new pair foo gets overridden. [Just a guess, no more]
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.
- References:
- Separation of API and implementation
- From: hforco2
- Re: Separation of API and implementation
- From: Daniel T.
- Re: Separation of API and implementation
- From: Dmitry A. Kazakov
- Re: Separation of API and implementation
- From: Daniel T.
- Separation of API and implementation
- Prev by Date: Re: Pattern/s sought
- Next by Date: Re: Separation of API and implementation
- Previous by thread: Re: Separation of API and implementation
- Next by thread: Re: Separation of API and implementation
- Index(es):
Relevant Pages
|