Re: Introspection API



On Fri, 2005-02-25 at 23:24 +0100, Maciej Katafiasz wrote:

>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:

>Some examples showing that structured information can indeed be put to
>good use:
>
>http://www.ondotnet.com/pub/a/dotnet/2003/07/28/understadingattributes.html

The examples on this page map very cleanly to string key-value pairs;
"org.gtk.GLib.XMLElementName" -> "myElement".

>> >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".
>
>http://www.nunit.org/exception.html -- 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.

>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.

>http://www.ondotnet.com/pub/a/dotnet/excerpt/prog_csharp_ch18/index.html?page=2#cust_attr

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

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]