Re: GInterfaces and API Stability



On Wed, 2007-11-07 at 20:47 -0500, Matthias Clasen wrote:
> On Nov 7, 2007 4:58 PM, Mike Kestner <mkestner novell com> wrote:
> > I have been working on the 2.12 bindings for Gtk# and have noticed a
> > stability issue for us related to GInterfaces.  In Atk and Gtk, it seems
> > there is no restriction against adding methods to stable GInterfaces.
> > There have been numerous additions to the Atk interfaces while in
> > "stable" mode.  A GetCells method was added to the GtkCellLayout
> > interface in 2.12.  There may be more, I'm still working through the new
> > API generated by our tools.
> >
> > We have recently added a GInterface registration capability to Gtk#, so
> > this is going to be a real stability issue for us, going forward.  We
> > can wave our hands and pretend these previous additions weren't
> > stability breaks since our GInterfaces were consume-only until now, but
> > with implementation support starting in Gtk# 2.12, subsequent additions
> > to existing interfaces will be problematic for us.
> >
> > While it may not break C ABI/API to add a method to an existing
> > GInterface, adding a method to an interface is a clear break in C#.  You
> > must implement all members of a C# interface, so code which previously
> > compiled will break when a method is added to an interface.
> >
> > I'm hoping this is just one of those "oops, never thought of that" kinds
> > of issues and the gtk+ and atk maintainers will avoid extending these
> > stable interfaces going forward.  It's a significant binding support
> > issue.
> 
> Well, I have certainly considered C ABI compatibility to be the main deciding
> factor when  making such decisions. I'd say if C# interfaces are inflexible like
> that then mapping GObject interfaces directly to C# interfaces was probably
> wrong.

One option that a language binding would be have would be to map the
extension of a GTK+ interface into

 GtkBorkable                        /* original version */
 GtkBorkable212 extends GtkBorkable /* new version with new methods in 2.12 */

A bit ugly, but I tend to agree with Matthias that further narrowing the small 
set of places we can extend GTK+ while preserving ABI/API compat is not a good 
idea. 

- Owen

Attachment: signature.asc
Description: This is a digitally signed message part



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