Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How to get Tobject descendant result from DataSnap server with FireDAC?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Apr 18, 2016 4:22 AM Last Post By: Mathias Burbach
Guest
How to get Tobject descendant result from DataSnap server with FireDAC?
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 13, 2016 11:01 AM
There is a nice Video of Paweł Głowacki on Youtube.
(I know there is a lot, but now focus on this one.)
The title is:
Delphi Labs: DataSnap XE - Passing "Plain Old Delphi Object" Parameters
YouTube ID: yWP2ZkVRx08

Datasnap server exposes method GetPerson with result of type TPerson.
Is it possible to connect to sample server mentioned in this video, and get the proper result with FireDAC?

Can I use FireDAC instead of DBX if I have to acess server methods returning some complex objects?
Mathias Burbach

Posts: 42
Registered: 12/8/99
Re: How to get Tobject descendant result from DataSnap server with FireDAC?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 18, 2016 4:22 AM   in response to: Guest in response to: Guest
Peter Miglinski wrote:
Can I use FireDAC instead of DBX if I have to acess server methods returning some complex objects?
Hello Peter,

you can use FireDAC to query your database and then construct a TPerson-like class on the server. But transporting "complex objects", objects that reference a list of other objects will not work with the method Paweł showed. The marshalling of TObject descendents is fairly basic in DataSnap. You will soon end up creating JSON objects and reconstruct the real classes on the client side from your JSON result. That JSON can always be transported no matter how complex it is. After all it is just plain text.

Salut,
Mathias
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02