I am migrating a win32 Delphi VCL application written in Delphi 2010 to a multi-tiered architecture.
The application makes extensive use of ExpressGrids (TcxGrid) by devexpress for databinding.
- I have designed the data tier based on Entity framework, using dbContext and Data transfer objects.
- I have expose the CRUD operations via WCF using T4 templates based on the entity data model.
That's all working fine, Delphi client successfully communicates with the WCF service, to exchange data transfer objects.
The problem is, how do I maintain the Databinding functionality? I am leaning toward writing a service method that returns a generic data table, or a dataset. Can I convert linq statement results to Datasets, tables or views? I am not sure I can bind Expressgrids to arrays of objects (WCF returns entity collections, but Delphi sees arrays). Has any one had experience with this type of interoperability?
EDIT
I have the data service returning DataSets, but guess what? The xml dataset from .net is not compatible with Delphi (2010 at least). I have managed to get that to work using the Gekko example (modified) , but it's not going to be practical due to the complexity of the queries we'd need to run from the client. Our options now, are to leave the Grids as they are until the BLL is complete and start a new project to re-write the client in C# (as a web or windows application) or, write a generic Grid plugin using RemObjects Hydra, to embed in forms with grids- trying to figure that out now.
Update I have dropped the Gekko DataSet implementation in favour of writing my own by studying the xml format required by TClientDataSet in Delphi. On the server side, I've implemented a service that returns TClientDataSet compliant xml in the form of a byte array. On the client I Load this into a TStringStream and then load the stream into the TclientDataSet component. I use this for small collections to provide lookups and data binding while we roll out the Hydra solution.
The xml roughly follows this format:
"2.0">
<METADATA>
<FIELDS>
<FIELD attrname="ID" fieldtype="i4"/>
<FIELD attrname="Status" fieldtype="string" WIDTH="10"/>
<FIELD attrname="Created" fieldtype="date"/>
<ROWDATA>
<ROW RowState="4" ID="1" Status="Code1" Created="20130707" Made="20130707T21:37:55341" Stopped="00:00:00000" Volume="1174" IsReady="TRUE"/>
<ROW RowState="4" ID="2" Status="Code2" Created="20130707" Made="20130707T21:37:55341" Stopped="00:00:00000" Volume="2149" IsReady="FALSE"/>
This is one of the few sources of information on the xml format.
I know the question is old, but I would appreciate any insights on interoperability and legacy code migration.
Thanks