viernes, febrero 25, 2005

Reflection only now supported in Mono

I've finally committed the code to support Reflection only methods in Mono to the SVN repository. Basically, the methods are designed to be useful in those cases when only metadata is needed, and no methods/fields/properties are used/invoked. This is specially good with tools that only need to load the metadata information (such method name, parameter types, field types, etc) to show app information, or have special neeeds.

A good description can be found here. This new api will be part of the next release of .Net (Whidbey), and currently no more information is avalaible.

However, here I have some additional details:

  • Reflection only and non reflection only assemblies are loaded separately, which means that it is possible to have loaded in both ways the same assembly.

  • MemberInfo and other elements will throw InvalidOperationException when calling Invoke(), which is the exception used to warn that the members are in a reflection only assembly, and thus can not be invoked/assigned.

  • References are not automatically loaded, which means that all of them should be manually loaded. Mscorlib is the only one that is not needed in this form, and currently we use the loaded one as if it were a reflecion only. Note that we *could* change this in the future, altought I don't think it will happen.

  • Custom Attributes are retrieved in the form of CustomAttributeData class, which contains the attribute information in a 'raw' way. CustomAttributeTypedArgument and CustomAttributeNamedArgument structs will contain the information about typed and named argument, respectively. (Note: We currently don't support this; however, I hope to have them in SVN as quick as I can)

Something very important to be noted, is the fact that we currently don't avoid the creation of some inneccesary data structures for ReflectionOnly assemblies. That will likely change in the next days/weeks/months, and it's a matter of performance, not of behavior (the impact is not that big).

Thanks to Zoltan and Paolo for their help.

3 comentarios:

Roberto Iza Valdes dijo...
Este blog ha sido eliminado por un administrador de blog.
Roberto Iza Valdes dijo...
Este blog ha sido eliminado por un administrador de blog.
Iza Firewall dijo...
Este comentario ha sido eliminado por el autor.