SPAM-LOW: Re: [nem-en] Metaphor, staging, typed reflection
Sandro Magi
smagi at higherlogics.com
Sun Jan 7 19:29:52 CET 2007
Kamil Skalski wrote:
>>
>> The plugin's public interface may be known at compile-time, but the
>> internal structure can not be known, as the end user is specifying a
>> class unknown at compile-time. This is a truly dynamic situation.
>>
>
> This is not a very good example, since you need to instantiate the
> object to use reflection on it. I would probably just send the ready
> assembly over the wire and place some "Deserialize (byte[])" method in
> the interface.
Yes, you need the class/assembly, but regardless, you still need to be
able to populate the fields, and this requires runtime reflection and
compilation/code generation. I'm not sure why it's not a valid example.
> Then I could use serialization implementation provided
> by assembly (and generated at compile-time on the client/provider of
> plugin-side) to instantiate fetched data into objects.
The end result is the same. You're trusting some dynamic code generation
algorithm which isn't statically checked. Metaphor gets you at least
part way to static checking this code generation.
Sandro
More information about the devel-en
mailing list