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 6921053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:13:37+00:00 2026-05-27T10:13:37+00:00

I have a scenario where I am starting with an Order Message. Over time

  • 0

I have a scenario where I am starting with an Order Message. Over time the message could be modified (into different versions). What would be a good approach to see what version the message is and pass it to the appropriate processing mechanism? I could look at the version (Will always have a header with version info, etc) and then use a case to send it to the proper parser (Currently using LINQ to XML). However, that doesn’t seem very elegant. Especially if we have like 10 versions we need to support.

Nothing pops out to me…just wanted to see how others would approach this.

  • 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-27T10:13:38+00:00Added an answer on May 27, 2026 at 10:13 am

    Multiple Parsers

    If you have X versions of the schema, you’ll need X code paths to handle them.

    To pick your implementation you’re going to have to have a switch statement somewhere. That switch could simply call methods, or it could be in a factory method that returns the correct parser (class or delegate).

    This doesn’t preclude you from sharing parts of your code between versions, and it is a good idea to break down your parsing into its component parts in order to support this. You can break them down via classes or via methods.

    You could have a common base interface to kick off parsing any version, and get back the object graph that the XML represents. The resulting object model should ideally be as version independent as possible so you can share common functionality.

    Upgrading Data

    Alternately you could use XSLT to upgrade the data, and use only one parser.

    You can either implement this once for each version and chain all the transforms, or you can transform directly to the latest version and modify previous version’s transforms with every release.

    Chaining transforms has better maintenance cost. Direct transform has better perf.

    You’ll still need a switch for this 🙂

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

Sidebar

Related Questions

I'm just starting with Windsor, so please be gentle :) I have a scenario
I have the following scenario: android up, compatible starting with android 1.6 and up.
I have scenario where I have to use the same XSD element for different
I have a scenario that my load balancer translates port 80 from outside into
I am just starting out with unit testing and have a scenario I'm not
I have a situation where I'm starting a process in my code in order
I'm starting with JSON/Ajax development with Javascript and right now I have a scenario
I'm starting to use Simple.Data a bit more seriously and have the following scenario
I have a following fairly simple scenario: Some data needs to be written into
I have scenario, I have two update panels on the page (both have update

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.