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

  • Home
  • SEARCH
  • 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 902905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:47:31+00:00 2026-05-15T15:47:31+00:00

We store objects in XML. Sometimes we update the base objects, then we have

  • 0

We store objects in XML. Sometimes we update the base objects, then we have to save more data in our files to represent the extra attributes of our objects.

How to organize/implement a system to ensure backwards compatibility with old versions of our files?

The complicated part comes when looking at several versions at once.

Version 1 -> Version 2 -> Version 3 -> Version 4

Should we write four file readers, one for each version of the file to read it into the current latest version of our object? Or, should we keep all the old versions of the classes around from versions 1-3 so that the old readers can read the data into those classes, and then have incremental updaters to update 1->2 and then 2->3 and then 3->4.

  • 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-05-15T15:47:32+00:00Added an answer on May 15, 2026 at 3:47 pm

    When I increment versions like this I typically keep the old reader, and just update it to write into the new model. This means I only have the current model for the rest of my code to deal with, but I can still read old files. I would not keep old classes around, no matter what other choices you may make – you want to localize the number of places in your code that have to understand old versions to as few as possible (preferably one). If you keep old classes around, then any code that deals with those classes (even as derived from a common base) runs the risk of having to “know” about old versions, and that creates an unmitigated maintenance disaster after a while.

    This is NOT a panacea…all the obvious options have issues. Once you have more than a few old readers, it becomes really time consuming to update them all (and god forbid you refactor some code they require into a new namespace and then have to edit effectively the same code 100 times to replace names). However, I usually just use this as a gateway to getting rid of old versions entirely – if you resolve to only have a few old version readers floating around for backwards compatibility, you can start deleting the oldest ones every time you make a new one, making the maintenance considerably less of a headache.

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

Sidebar

Related Questions

I have a collection of nodes xml.dom.Node objects created using xml.dom.minidom. I store them
I have to use an xml database (Sedna) to store and retrieve Java objects.
in my project i have xml file to store and retrieve Device Objects and
I store objects of a custom data type in QStandardListItems. I recover these objects
I'm receiving data from web-services in XML and I'm using that data via objects,
The project I have been given is to store and retrieve unstructured data from
I have a set of data created by another app and stored in XML
I have a list of objects (created from several text files) in C#.net that
Java collections only store Objects, not primitive types; however we can store the wrapper
I am using a hashmap to store objects with a key that evolves over

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.