J
JJ
I've got an n-layer application that fetches data from an SQL database using
stored procedures.
This information is read into various classes which represent a hierachical
structure:.
eg.
public class Page : Base_Page
{
private int _parentPageID;
public int ParentPageID
{
get { return _parentPageID; }
set { _parentPageID = value; }
}
private List<Page> _ChildPages = null;
public List<Page> ChildPages
{
get { return _ChildPages; }
set { _ChildPages = value; }
}
etc,
}
I have just realised that I really need the information to be represented in
XML format. It's hierachical data and I will want to display it in some
hierachical controls.
So, I am wondering which is the best route to take to achieve this.
I understand that I could rewrite the SQLPagesDataprovider in the Data
Access layer completely to read the data directly from the SQL stored
procedure into a dataset and make it hierachical then use GetXML() to
convert it to xml, but is there a way I can add a layer to convert the data
fetched by the current provider (into a new instance of the 'Page' Class)
into XML, without having to rewrite it? I may not always want the data in
XML format, after all.
Hopefully that all makes sense.
JJ
stored procedures.
This information is read into various classes which represent a hierachical
structure:.
eg.
public class Page : Base_Page
{
private int _parentPageID;
public int ParentPageID
{
get { return _parentPageID; }
set { _parentPageID = value; }
}
private List<Page> _ChildPages = null;
public List<Page> ChildPages
{
get { return _ChildPages; }
set { _ChildPages = value; }
}
etc,
}
I have just realised that I really need the information to be represented in
XML format. It's hierachical data and I will want to display it in some
hierachical controls.
So, I am wondering which is the best route to take to achieve this.
I understand that I could rewrite the SQLPagesDataprovider in the Data
Access layer completely to read the data directly from the SQL stored
procedure into a dataset and make it hierachical then use GetXML() to
convert it to xml, but is there a way I can add a layer to convert the data
fetched by the current provider (into a new instance of the 'Page' Class)
into XML, without having to rewrite it? I may not always want the data in
XML format, after all.
Hopefully that all makes sense.
JJ