Adding Server Methods

As in the past, you can write methods in the server that can be called by the client. In the past, this was based on COM, so you had to add interfaces to the type library and implement then in the server objects, and call the methods using COM dispatch interfaces on the client. In DataSnap 2009 the remote methods calls, or server method calls, are based on Delphi's RTTI. Notice, however, that parameters passing is based on dbExpress parameter types, and not on Delphi language types.

You can have multiple server side classes that expose methods, but to continue with the simple project I've already built, I added an extra method to the server module class (in the server application), using the following code:

TDSFirst3TierServerModule = class(TDSServerModule) IBCONNECTION: TSQLConnection; EMPLOYEE: TSQLDataSet;

DataSetProviderEmployee: TDataSetProvider; private

{ Private declarations } publ ic function GetHello: string; end;

function TDSFirst3TierServerModule.GetHello: string;

Was this article helpful?

0 0
Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment