Re: Theory of good signal/event API design?




On Tue, 2007-09-25 at 22:16 +0200, Sander Marechal wrote:
[snip]

Actually, I am not interested in the underlying technology at all. What
I am interested in is: When you write a signal/event driven program or a
widget or whatever, how do you figure out what signals to send out, so
other people can actually do something useful with it?

It's a purely theoretical software engineering question. So far I have
been adding events to my application whenever I needed them myself, but
I would like to have a nice, complete set of events so other people can
do useful things with them too.

I had hoped that the GTK community, having built so many widget and
event driven applications, would have some kind of guidelines, theory,
policy or just general good advice on that.

As far as I could tell, the GTK + GLib design (and other similar
libraries) seems to be based on expected use-cases of the API, so asking
what potential users of the library code might want to do with its
objects and API.

So I guess for your code, you need to think about the objects you're
exporting, and what people might think to do with them. Then write API
which facilitates that.

The tricky thing is getting this right - especially if your ABI / API
has to be set in stone (like that for released versions of GTK + GLib).
I'm sure there are many things which would be changed in GTK if they
were written again now without the requirement to keep ABI / API frozen.

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)




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