Flex data retrieval, paging
We made really good progress this week adding Data Management Services support to WebORB 2.1 for .NET. Below is a list of things we have working:
- WebORB can read flex-data-services.xml and initialize all destinations from the file.
- Flex clients can use the DataService component to retrieve data from a .NET-based data source
- Paging support has two modes: 1) paged data can be retrieved from a cached data collection; 2) WebORB can go to the data access object (DAO) for every paging request
- Data access objects are plain .NET objects. Data can be returned as DataSet, DataTable or IList
- Using DataSet and DataTable can simplify the server-side code to the maximum. Here's an example of a method that retrieves data from a database:
[Weborb.Data.ReturnType( "samples.contact.Contact" ) ]
private DataSet loadContacts( string query )
{
DataSet dataset = new DataSet();
string cnxString = "..................";
OleDbDataAdapter aapter = new OleDbDataAdapter( query, cnxString );
dataAdapter.Fill( dataset );
return dataset;
}
Notice the ReturnType attribute. The attribute specifies the type of the data contained in the returned DataSet. Since the dataset contains raw data from the database, WebORB automatically serializes it as a collection of complex types. Each column becomes a property of the type in the collection and contains data from the corresponding row cell. The attribute provides information about the client-facing classname each complex type object is tagged with. In the example above, each row in the dataset will be serialized as a samples.contact.Contact object. - The client side code is identical as with FDS. Applications can create DataService component and use it to retrieve data from the server.







