[Mono-devel-list] Creating types at runtime

August Steinbacher august.steinbacher at gmx.net
Wed Mar 10 06:06:28 EST 2004


Thanks Jon...

to be more precise, the goal of my work is to dynamically (at runtime)
integrate type information into the Mono runtime and thus allow Mono
programs to use externally defined types as if they were available in the
managed environment. The external types could come from C / C++
applications, and they must have a well-formed type-description given as an
XSD-schema, which resides somewhere in a kind of metadata.

At the moment, everything is quite fuzzy for me, so I'm happy about every
kind of help. So, thank you for your answer, now i know where to start. I
hope I'm getting more into Mono the next days and can contribute to the
Mono-project in the future...

best regards,
august


> Below...
>
> On Tue, 2004-03-09 at 08:31, August Steinbacher wrote:
> > Hello all,
> >
> > I am starting to work on a mechanism that allows managed programs to use
> > unmanaged objects and vice versa.
>
> Sounds like Platform Invoke, depending on how you define "unmanaged
> objects."  Unmanaged C++ objects?  Or "object" meaning "memory"?
> Something else?
>
> > My first task is to create a type object at runtime from a given tye
> > description in the form of XSD.
>
> Simple enough -- you want to write a compiler that translates the XSD
> into a set of types.  Look into System.Reflection.Emit.  Looking at the
> source to "mcs" might be helpful as well.
>
> > So my question is if anybody has concerned with this topic and maybe
could
> > give me a slight kickoff and head me in the right direction (since I'm a
> > bloody mono-newbie...) ?
>
> My "slight kickoff" is above, though you haven't provided much
> information about what *exactly* you're trying to do.
>
> One thing to keep in mind is that Mono is a statically-typed
> environment.  Which means that you can't have existing, pre-compiled
> code directly reference a set of classes you'll be generating at
> run-time, as the classes won't exist yet. :-)
>
> A workaround would be to define a set of interfaces/base classes that
> your generated code will implement/derive from, and that existing code
> can compile against.  Regardless, your design will need to take this
> into consideration.
>
>  - Jon
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>




More information about the Mono-devel-list mailing list