2

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

reckface
  • 5,678
  • 4
  • 36
  • 62
  • Wow! Another tumble-weed question. – reckface May 04 '12 at 10:57
  • Truth is, there is no easy interoperability between Delphi and C#. I have been able to achieve databinding by building a clientdataset based on an example from ExpertsExchange. It involved overriding the OnAfterExecute event for the HTTPRio component, and manually parsing the soap envelope to create the DataSet structure, and then populate the data. – reckface May 04 '12 at 10:59
  • I've looked into WCF Data services (oData), and it might be better for data binding, but I'll also have to write some logic to parse the returned atom feeds. Also I'm not sure how to query related data from the url. – reckface May 04 '12 at 11:01
  • Ok, more information. Delphi 2010 WCF support is flaky. The WSDL importer appeared to work initially, but as the complexity increased, the WSDL importer goes into an infinite loop. In the end, I had to expose the services as ASMX wsdls, and now a 1.6MB wsdl import pas file is now 300K. And the integration is almost flawless. I still haven't figured out a robust way to data object collections to grids in Delphi, also it appears all the information on Multi-tier solutions omit a multi platform solution. It's all Delphi, or all .Net. It's been a good learning experience so far. – reckface Jul 16 '12 at 08:59
  • Your question is well written, but you seem to have quite an exotic combination of technologies. If you gain some more SO reputation you may be able to attract more/new attention by offering a bounty on this question. – Jeroen Sep 18 '12 at 20:53
  • We are now experimenting with RemObjects Hydra. Stuck at step one for now... – reckface Oct 05 '12 at 16:06

0 Answers0