c# - Providing serialization services in a base class that can be used in derived classes -


I have implemented a data access library which allows deities to mark their derivative classes with attributes, so that they Processes can be stored directly. So far, so good. Now I want to provide a serialize () method or override toasting (), and the derived sections have to get free serialization in XML.

Where should I start? Do I have to use reflection to do this?

XML serializer using XML serializer

In the first example, Will look in the framework that supports the serialization of objects and uses one from XML.

The following links provide examples of using this approach:

  • Iasisable and SerializeAttribute

    One option of this must be to use a formatter and regular and serialization system. However, there is no built-in XML format besides this framework, so you have to roll yourself or get a third party / open source implementation.

    Do your own roll

    Also, to run on your object tree, you can consider writing your own system using serializing items according to your serialization visibility. Which can be shown according to your own characteristics or existing characteristics. The downside to show by most implementations is that it expects to read / write the property publicly, so keep this in mind when evaluating existing custom solutions.


    Comments

    Popular posts from this blog

    c++ - Linux and clipboard -

    Visual Studio 2005: How to speed up builds when a VSMDI is open? -

    booting ubuntu from usb using virtualbox -