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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:12:33+00:00 2026-05-13T18:12:33+00:00

I am reading data from another system that returns XML that provides the following

  • 0

I am reading data from another system that returns XML that provides the following information for each field:
“Field Name”, “Data Type”, and “Size”. The “Data Type” returned is either: Alpha, LAlpha, RAlpha, CAlpha, or Numeric. Sometimes there are other attributes returned as well, such as Casing. I would like to create objects to model the data returned and also have to generate xml with element values formatted according to the given data type to send back to the other system to perform transactions. I started off creating an object that would represent each property on the object like:

//Type T represents the data type of the Value property
public class OtherSystemField<T> : IOtherSystemField{ 

public string OtherSystemFieldName { get; set;}
public OtherSystemDataTypeEnum OtherSystemDataType { get; set;}
public int Size { get; set;}
public T Value { get; set;}
public string ToOtherSystemString() { ....};

}

//Class using the data field
public OtherSystemEntityClass {

public OtherSystemField<string> f1 { get; set; }
public OtherSystemEntityClass () {
f1 = new OtherSystemField<string>() { 
OtherSystemFieldName = "x", Size = 4, OtherSystemDataType = ...};
f1.Value = "DefaultStringValue"; 
}
}

The question is does this representation of the other system’s data fields make the most sense, using this type of object to model a field from the other system instead of a .Net data type property that is associated with some meta-data?. Any opinions on, say, having the property have attributes containing these values like:

public OtherSystemEntityClass {

[OtherSystemFieldName("SomeFieldName", 5, OtherSystemDataTypeEnum.RAlpha)]
public string f1 { get; set; }

}

Here is an example of the XML:

<COLUMNS>  
<COLUMN header="FieldX" dspname="FieldX" dbname="FIELDX" type="NUMERIC" size="4" /> 
<COLUMN header="FieldY" dspname="FieldY" dbname="FIELDY" type="ALPHARIGHT" size="14"/>        
</COLUMNS> <COLS> <COL><![CDATA[ 1000]]></COL> <COL><![CDATA[ 102]]></COL> </COLS>

I look forward to everyone’s feedback – I have no doubts I will hear good perspectives.
Performance is not of a huge concern, as the number of fields is relatively small. Also, this is implemented in .Net 3.5

  • 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-13T18:12:34+00:00Added an answer on May 13, 2026 at 6:12 pm

    I’m not sure what the “Alpha” types are, but the newly-added XML snippet is clearly describing a table schema. If you can pull off a mapping, I might actually use a DataTable instead of creating any custom classes at all.

    I wouldn’t be too surprised to find out that the XML is literally serialized directly from something similar to a .NET DataSet/DataTable but in a different language/platform. Those CDATA tags are not consumer-friendly. But if you can map Alpha values to some enum type (most likely a custom one you create), then you can just add a column of that type to a DataTable.

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

Sidebar

Ask A Question

Stats

  • Questions 334k
  • Answers 334k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer efforts |> Seq.sumBy (fun e -> e.Amount) May 14, 2026 at 3:29 am
  • Editorial Team
    Editorial Team added an answer For the second part of the problem above, here's a… May 14, 2026 at 3:29 am
  • Editorial Team
    Editorial Team added an answer From your description it sounds like a Product is a… May 14, 2026 at 3:29 am

Related Questions

I am attempting to develop a service that contains numerous client and server sockets
I am using JPA with Hibernate underneath, and I am having trouble getting merge
I often want to trigger a certain function just once, but I need to
I have a PropertyGrid in my application that is used for editing arbitrary objects.
I have an ASP.NET web application which does the following: Reads an Excel file.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.