Re: dbus glib bindings: deriving from G_TYPE_BOXED, parameterized types
- From: Tim Janik <timj gtk org>
- To: Matthias Clasen <mclasen redhat com>
- Cc: Gtk+ Developers <gtk-devel-list gnome org>, dbus lists freedesktop org, Colin Walters <walters verbum org>
- Subject: Re: dbus glib bindings: deriving from G_TYPE_BOXED, parameterized types
- Date: Mon, 16 May 2005 15:16:49 +0200 (CEST)
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]