Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8857231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:32:28+00:00 2026-06-14T14:32:28+00:00

As far as my understanding goes most of the serialization/de-serialization technique uses reflection to

  • 0

As far as my understanding goes most of the serialization/de-serialization technique uses reflection to create object and set or get values. So why do one explicitly bind these attribute such as [XmlIgnore]… for xml, [Serializable]… in Binary serialisation, [JsonPropery]… Json.Net etc in the class. Since these are like cross cutting concerns as a far as an object concerned, cant we do the same outside the object?

If the concerns are separated the user can have control over which portion of the object graph/tree one needs to serialize/de- serialize under which context and how etc?

Is there any such framework that makes the entire serialization as aspect, i.e. outside the concern of the classes?

Edit1: My requirements are as follows
My application stores the data in a huge tree structure. The customer requirement is to be able to serialize certain data in xml format, and certain portion of the data in Json (I do not know why such requirement) and we have most of the data serialized in binary as a legacy code.

Now that there are classes in which a portion of the data needs to be shown in XML format and another portion (these can be part of the xml data or binary serialization data as well) in Json.

So I am looking for a solution in which

  1. Classes should not be aware of any serialization specific attributes, instead the serializer framework can give enough tools to easily do serialization without touching the class.
  2. The framework should allow persisting both private and public data which I wanted. This can be specific to a class or instance or specific to some properties of an instance in some context.
    E.g.

    • SaveTemplate: Should save only few nodes from each branch of the
      tree
    • SaveDocument: Should save one branch from the tree
      completely
    • SavePackage: Should save entire tree.
  3. Should allow serialize into different format, such as xml, binary, json etc for different purposes.

So I am planning to evaluate certain Serialization framework to achieve the same. I found Json.Net which can give me the following

  • No serialization tag to be put for public properties just like xml serialization.
  • Backward compatibility to Binary Serialization. i.e. I do not have to change the binary serialization interface implementation
  • Does not need a parameter less constructor.

However I still need the capability mentioned in point 2) and 3) above.
I have not yet explored Json.Net in detail or any other framework.

Does any framework can help me achieve the same?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:32:29+00:00Added an answer on June 14, 2026 at 2:32 pm

    With your edit, referring to private fields among other things: frankly you’re stretching the feature-set of what any one serializer will offer. You can probably use extension APIs to do some of it, but it’ll be a lot of work, and not 100%. You will spend a lot if time fighting the serializers and debugging.

    In such cases, there is a much better solution: write a set of DTO types completely unrelated to your domain entities. Serialize/deserialize the DTOs – feel free go annotate the DTOs like there is no tomorrow: their single purpose is to express serialization intent. Then just map to/from the DTO and entity types.

    This way, you get the best if both worlds. The serializers are happy with the DTOs (and you can shape the data as you want, by tweaking the DTO types), and your domain entities are squeaky clean, completely unaware of serialization concerns.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As far as my understanding goes Object is also a class in java. So,how
I'm trying to get a better understanding than I've been able to so far...it's
As far as my understanding goes Modules kann be used to split an Application
This one is a bit tedious in as far as explaining, so here goes.
I am trying to get a better understanding of CRTP. So far my understanding
As far as my understanding goes, once we complete the 'listen' call with bound
In mySql, as far as my understanding goes, its possible for us to grant
Could someone clear something up for me? As far as my understanding goes, the
As far as my understanding after reading and researching, the purpose of using salt
I've come os far as to gaining basic understanding of prepared statements and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.