Single-tier IntraWeb and RemObjects DataAbstract server PDF Print E-mail
Written by Bernhard Fischer   
Tuesday, 20 February 2007
Article Index
Single-tier IntraWeb and RemObjects DataAbstract server
Page 2
Page 3
Page 4
Page 5
Page 6
Page 7
Page 8


Next we select Turn IWRODA into a Remobjects SDK server from the Delphi Remobjects menu. This will adapt the project file to generate required files after we defined our services. Now we are asked if we want to launch the ServiceBuilder to define a service, and that's exactly what we will do. Let's rename the service library to IWRODALibrary and add 4 services (CalcService, DataService, LoginService and TimeService). The next step is to include DataAbstract RODL because we want to define one of our services as DataAbstract service (we can use DA features for local data access in non-DA services too, as we will see later on).



click to enlarge

 

The services TimeService and CalcService will implement methods we all know from the standard RO examples ( Sum and GetTime ), so you add the simple code yourself in the CalcService and TimeService . We will look at the LoginService and DataService in detail, as they deal with database access via DA. First the LoginService - simply add a method called Login with two input parameters (iUsername: string, iPassword: string) and a boolean result . Now the DataService - because we included the existing DataAbstract RODL, we can now use the DataAbstractService as anchestor for our DataService.


click to enlarge

 

There is nothing more to do now, as everything is implmented in the included definition. So after closing the ServiceBuilder, we compile our application and select the Remobjects SDK Remote Datamodule three times when suggested. The 4th module will be automatically created as DataAbstract Datamodule because of it's inheritance as defined in the ServiceBuilder.
After the 4 new units have been added to our project, we first complete the DataService_Impl unit. Drop a TDABinDataStreamer and a TDASchema on the module and give some meaningful names again ( schemaUsers and streamerUsers , as we will access the users table in our database). After setting the service module's ServiceSchema and ServiceDataStreamer properties to the components we just added, now include the uGlobalDataModule unit in the uses clause and link the schemaUser's ConnectionManager property to GlobalDataModule.mgrConnections.
It's time to define our schema. Double click on the schemaUsers component to launch the DA Schema Modeller. Add a IBX connection to the database we initially created. Let's call it IBX Connection. For this example it's sufficient to simply drag & drop the table USERS from the Data Explorer pane to the Data Tables pane. After closing the Schema Modeller, enter IBX Connection in the DataService's Connection property. That's it for now in the DataService module.
Don't forget to complete the simple methods GetTime in TimeService_Impl.pas and Sum in CalcService_Impl.pas as usual, as we will use them later.




Last Updated ( Friday, 18 January 2008 )
 
Next >