ekonbenefits / impromptu-interface

Static interface to dynamic implementation (duck casting). Uses the DLR combined with Reflect.Emit.
Apache License 2.0
656 stars 67 forks source link

Serialization #7

Closed gsogol closed 11 years ago

gsogol commented 11 years ago

More of a question...but can one plug in their own serialization to utilize ActLike? Or does this only work with dynamic objects? I'm asking because I work with XSDs and XML. I can see it works with json and I'm assuming it uses some sort of a serializer.

jbtule commented 11 years ago

No serialization, it will proxy, which has the added benefit of not being lossy. http://kellabyte.com/2013/05/02/serialization-is-lossy/

So you could use wrap it around XML objects, but the objects would need to support a dynamic interface, such as inheriting from DynamicObject or implementing IDynamicMetaObjectProvider

It works out of the box with Json.net, because json.net implemented it's objects as usable via dynamic.