[prev in list] [next in list] [prev in thread] [next in thread]
List: gtk-devel
Subject: Re: GInterfaces and API Stability
From: Mike Kestner <mkestner () novell ! com>
Date: 2007-11-14 16:08:27
Message-ID: 1195056507.10919.14.camel () t61p ! site
[Download RAW message or body]
On Wed, 2007-11-14 at 14:00 +0100, Alexander Larsson wrote:
> > I guess that new vfuncs are usually tested for NULL before being called.
> > Actually, I'd expect this for all vfuncs. In general, I'd expect the
> > interface to adapt to not having its new vfuncs implemented. C can do
> > that.
>
> That is not strictly needed. GInterface allows you to implement default
> fallback code for interface members.
The problem with this capability is that it produces ambiguity in the
API. If I am developing an application and I see that GtkCellLayout
exposes a GetCells method, and I use a widget from libfoo which
implements GtkCellLayout, but not the version of GtkCellLayout that
exposes GetCells, I have to know that explicitly or my program is going
to produce unexpected results. I don't see how a fallback
implementation of GetCells can do anything but avoid crashes and return
null.
Using GInterfaces in this manner amounts to a mechanism which describes
all the methods which might be implemented by an object. I'm not sure
how useful that is to an application developer.
--
Mike Kestner <mkestner@novell.com>
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic