المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Class design related clarification c#



C# Programming
09-21-2011, 03:00 AM
I have a design related question. So please guide me on how to do this?

Right now, I have a xml structure which will be in this format.

23 46 ...
So, we have a class like this to store each & every element of the sheet.

Sheet
{
Public string SheetId
{
get; set;
}

//all Elements will be stored in the below collection
Public IList Elements
{
get; set;
}
}

But now for few sheets the format has been changed to the below structure.

//SheetId ...
So, we need to create a Generic class to hold the above xml formats and we don't want to have different object to store these.

I mean in future if we have some other xml format also we need to accommodate the same without any change in the Sheet class.

Ok. let me explain how my app works.

Actually we have around 200 sheets(in other words measures).

1) User will upload the sheet data in xml format (all sheets in xml file) & edit the same if they want Or Enter the data in the screen (dynamic screen generated using the xml template) if they dont want to upload.

2) Then the data will be stored in the Sheet object and it will go through lot of Validation process and finally the data will be converted to xml again and stored in the db.

You can ask why you want to store this as XML? The reason is we dont want to create 200 aspx pages for this same kind of data and thats why we are generating the sheet pages dynamically using the xml templates. Also, we will be adding, updating or deleting sheets frequently.

Ok. I think now you will have some idea about this issue.

To be more clear, all the elements in my XML file will be displayed as a field in the aspx page. It maybe a Textbox, dropdown & etc....

So, can anyone please advise me on how to design the Sheet Class.?