Re: dbus glib bindings: deriving from G_TYPE_BOXED, parameterized types



On Fri, 13 May 2005, Matthias Clasen wrote:

On Fri, 2005-05-13 at 13:01 -0400, Colin Walters wrote:

As I just pointed out to Colin, using derivation to model the relation
between generic types and their specializations is not really adaequate,
since you violate the substitution principle: a List<int> can not be
substituted for a List, since List promises you to store arbitrary
objectds, while List<int> can only store ints (which is why generic
types systems like the one in Java 5 don't do it like this).

what kind of substitution is that? having an abstract or very generic
base type (List) and specialization in derived types (List<int>) is
fairly common practice in inheritance patterns.

We may need a different way to model the "is a specialization of this
generic type" relation.

hm, and exactly why do we need that?


Matthias

---
ciaoTJ



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]