Re: Best Method Question: Passing Numerous Transactions To Web Service
- From: "John Saunders" <no@xxxxxxxxxxxxxxxx>
- Date: Sun, 28 Sep 2008 21:59:03 -0400
"Eric Fortin" <emfortin@xxxxxxxxxxx> wrote in message news:exgq9vZIJHA.728@xxxxxxxxxxxxxxxxxxxxxxx
I am currently passing a dataset and am being told that is "bad practice". What is the current thought for "best practice"
DataSets or any other .NET-specific types are bad practice in the sense that they are not interoperable. Instead, follow the Data Transfer Object pattern by returning simple types, arrays, structs, etc. For instance, to emulate a multiple-table DataSet:
public struct Table1Row {
public int ID {get;set;;}
public string Column {get;set;}
}
public struct Table2Row {
public int ID {get;set;;}
public string Column {get;set;}
public Table1Row RelatedRow {get;set;}
}
public class Table1 : List<Table1Row>
{
}
public class Table2 : List<Table2Row>
{
}
public class DataSet {
public Table1 Table1 {get;set;}
public Table2 Table2 {get;set;}
}
OTOH, if you don't now, nor ever will, care about interoperability, then go ahead and use a DataSet.
--
John Saunders | MVP - Connected System Developer
.
- References:
- Best Method Question: Passing Numerous Transactions To Web Service
- From: Eric Fortin
- Re: Best Method Question: Passing Numerous Transactions To Web Service
- From: Paul Montgumdrop
- Re: Best Method Question: Passing Numerous Transactions To Web Service
- From: Eric Fortin
- Best Method Question: Passing Numerous Transactions To Web Service
- Prev by Date: WCF persession
- Next by Date: Web service to return xml file
- Previous by thread: Re: Best Method Question: Passing Numerous Transactions To Web Service
- Next by thread: web service software factory + visual studio 2008
- Index(es):
Relevant Pages
|