Re: GInterfaces and API Stability



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>



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