Tutorial 3
Tutorial 3
Goals
1. Implement a RAD Client which connects at Database direct in our Server.
2. Implement an API that exposes the behavior of Restaurant for any language.
I hope you had already implemented the structure presented at Image 8. The architecture of
RestDWPooler. This diagram show how to configure a full functional database on server,
that is just enough available to consume in another Client Application. Don’t worry if you
didn’t understand yet. I will implement that structure again step by step.
In this example I’m using the Firedac Connection, because this I’ve putted the
component TRestDWDriverFD. Look at your “RestDataware Core Drivers” palete if you have
already installed the driver you want. Other drivers are available to install at RDW Folder, for
example Unidac, Zeos, etc. In component Driver has a property to setup your connection.
And it is all! That is the secret to keep simple to configure and to flexible scale your
application in the future. You can easily change to another database or aggregate another
connection for different purposes.
Each Connection you want to configure you need to put another RDWPoolerDb and another Driver.
20
We create our Server that has RDWPoolerDb, which provides full access to our
Database. I don’t know which database you are using, to prove you the database layer
doesn’t mind. I mean the database looks like a classical Delphi Client-Server application. The
RestDataware will create ever mechanics you need to access this database remotely.
If you did not configure your database connection correctly the connection error will appear
on your client.
Save your server application, and then compile it. I recommend you open another Delphi to
create the client. You can also add a new application for current project group. Save as
Client.DPR
RestDwClientSQL
21
Connect RestDwClientSQL to RestDwDatabase. Fill the SQL text. You can use the
RestDwClientSQLEditor to perform the SQL you want. As you can see the tables of
connection appear on left side, also the fields of selected table. Everithing is very familiar if
you have used Delphi already. Add a grid and connect to see the magic have done.
22
Contact
If you have some question about RestDW have a look at installation guide, otherwise you
can send to me an e-mail at [email protected].
Visit my github to get some Delphi example. I will publish exclusive contents about RestDw
library.
23