Re: Introspection API

Dnia 25-02-2005, pią o godzinie 18:22 -0500, Colin Walters napisał:
> >I know that DBUS is one of bigger users that are guaranteed to make use
> >of introspection the day it lands in HEAD :). Serialisation as in
> >marking interfaces which are supposed to be serialised, ie. prepared for
> >use over IPC, like .NET's SerializableAttribute, serving as hint for
> >runtime that you intend to use that class for remoting. 
> First, I think you are getting confused between serialization and
> remoting.  They're related but different.
> Second, your original statement was "Serialisation (ie, autogeneration
> of DBUS bindings for GObjects)", which is weird because serialization is
> entirely unrelated to D-BUS bindings.  But anyways:

Yes, I was using some inaccurate mental short-circuiting here, sorry if
that has made you uneasy :).

> >Some examples showing that structured information can indeed be put to
> >good use:
> >
> >
> The examples on this page map very cleanly to string key-value pairs;
> "org.gtk.GLib.XMLElementName" -> "myElement".

Yes, but you're separating it from related values this way, instead of
keeping it all in one, nice package. And what if you want to set
org.GLib.XMLElementIndent to (int)4? You're gonna be parsing strings
back and forth soon.

> >> >2) Unit tests (you can mark functions that are tests to be run, and
> >> >expected outcome)
> >> 
> >> I don't see why you need anything other than strings for this; just have
> >> a standard annotation named org.gtk.GLib.Test with a value "true".
> >
> > -- notice that what's passed in is
> >type, not string, so you can manipulate it right away without fiddling
> >with (de)serialising to stringified version.
> This one is a good example, but not sure it's really worth going from
> strings just for this.

This is one possible example only. Give people useful tool, they will
make use of it :). The above shows that real-life application does exist
for this particular tool.

> >I'd envision things like mapping types (python's dict vs. glib's hash
> >table), where being able to express things in structured way would
> >de-uglify the process a lot.
> Not sure what you're saying here.  Would this be e.g. a desire to note
> that a particular GHashTable maps string->string?  Perhaps what we could
> do here is register GTypes for this, or make the introspection type
> system more recursive.  Note in Java and C# this stuff is part of the
> core language, not annotations.

Not really, what I wanted to say is that stuff which would tell that
equivalent of GHashTable in Python is dict is most probably going to be
complex, and would benefit from being able to carry more than just a
string here.

> >
> This particular example isn't all that convincing either, IMO.  It's a
> poor replacement for version control anyways :)

Oh, c'mon, it's only an example. Don't expect me to come up with totally
ground-breaking application in 3 minutes in which I reply to a post :).


Maciej Katafiasz <ml mathrick org>

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