Delphi Labs: New "Server Methods Lifecycle" episode is live!
It is more fun and work as I expected but here there is: The third episode in the Delphi Labs "DataSnap" serie. My goal is to consistently release one new episode about Delphi DataSnap programming every week in this quarter. The demos are intentionally simple and all the steps documented in a detailed way so it should be OK to follow even for non-experienced Delphi XE users. In the video episodes I have decided to reduce resolution, but I am still doing zooming and panning in Camtasia before producing a file to mp4. If you have any feedback regarding the format of Delphi Labs please do not hesitate to comment here. Appreciated!
In the first part of this lab I'm using Delphi XE to build a DataSnap VCL Forms app server and client application. The server method instance has overridden constructor where its private FID is initialized with a generated GUID and "GetId" server method is implemented to be able to uniquely identify a server methods instance on the client. The client app has a button and a label where the value of server method instance ID is displayed. At the end we see that with default DSServerClass.LifeCycle value of "Session" every connected client has its own server methods instance inside the server application.
“Delphi Labs: DataSnap XE - Server Methods Lifecycle (Part 1/2)”
http://www.youtube.com/watch?v=VI_o6bwIfkM
In the second part of the lifecycle demo we are extending both server and client applications. In the server we are adding two new TDSServerClass components with other possible values for lifecycle: server and invocation. Implementations of all three server classes are identical and they provide "GetID" server method that returns an instance GUID value and let us identify instances inside the server. The client interface is extended and DataSnap proxies are regenerated. At the end of the demo we verify that server method instances are global to all clients, session instances are unique per client and invocation instances created and destroyed on the fly.
“Delphi Labs: DataSnap XE - Server Methods Lifecycle (Part 2/2)”
http://www.youtube.com/watch?v=XcLOm-v7Ing
The source code for this demo is available at http://cc.embarcadero.com/item/28199 and whitepaper at http://edn.embarcadero.com/article/41289
In the first part of this lab I'm using Delphi XE to build a DataSnap VCL Forms app server and client application. The server method instance has overridden constructor where its private FID is initialized with a generated GUID and "GetId" server method is implemented to be able to uniquely identify a server methods instance on the client. The client app has a button and a label where the value of server method instance ID is displayed. At the end we see that with default DSServerClass.LifeCycle value of "Session" every connected client has its own server methods instance inside the server application.
“Delphi Labs: DataSnap XE - Server Methods Lifecycle (Part 1/2)”
http://www.youtube.com/watch?v=VI_o6bwIfkM
In the second part of the lifecycle demo we are extending both server and client applications. In the server we are adding two new TDSServerClass components with other possible values for lifecycle: server and invocation. Implementations of all three server classes are identical and they provide "GetID" server method that returns an instance GUID value and let us identify instances inside the server. The client interface is extended and DataSnap proxies are regenerated. At the end of the demo we verify that server method instances are global to all clients, session instances are unique per client and invocation instances created and destroyed on the fly.
“Delphi Labs: DataSnap XE - Server Methods Lifecycle (Part 2/2)”
http://www.youtube.com/watch?v=XcLOm-v7Ing
The source code for this demo is available at http://cc.embarcadero.com/item/28199 and whitepaper at http://edn.embarcadero.com/article/41289
Tags:
DataSnap
DataSnap
DataSnap XE
Delphi
Delphi
Delphi Labs
Delphi Programming
Delphi XE
DelphiLabs
ednfront
source-code
source-code
XE


Crazy about Delphi Programming!
Comments
-
Please login first in order for you to submit comments
- Page :
- 1
Hi Pawel,
I tried some of your Delphi Labs demo's on XE2. I ran the Lifecycle demo. The error I get when starting up more than one Client at once is for some of them "Connection Closed Gracefully" or "Socket Error # 10053, Software caused connection abort".
Any clue?
- Franz Maurer