Hi.

Hi.

I have to build the next scenario:
- ClientApp build with Intraweb
- DataSnap REST Server with Firedac, let's call it WS-BL (Business Logic)
- DataSnap REST Server with Firedac, let's call it WS-DB (access to Data Base)

1.- ClientApp has to consume the WS-BL
2.- WS-BL will have the validation of the data and consume the WS-DB
3.- WS-DB will have all the SQL statement

For all I had read, with Firedac in DataSnap REST Server I get the serialization of the Data in JSON format. The ClientApp deserialize the Data using the component TFDMemtable. This is the "standard" 3 tier applications.

Now in my scenario, I need to consume the WS-DB from WS-BL (which add one more level to the "standard" 3 tier applications), with this new level it's mean that the ClientApp doesn't know about WS-DB, the ClientApp only knows about WS-BL.

So, all the methods from the WS-DB returning the data, inserting, updating, deleting and all the other stuffs with the database the WS-BL needs to consume and pass it away to the ClientApp.

How can I do this???

I'm relative new in this "technology" of Webservices and DataSnap REST.

I hope been clear enough.

Comments

  1. It's a common and "normal" architecture: business layer reads data from any source and provides it to clients as classes, that some call "Data Transfert Object" (DTO), or " Plain Old Delphi Object" (PODO). That's the behavior of an ORM. Now if your business layer is separated from client (remotely I mean), I guess that you'll have to serialize these objects again --> back to JSON.

    ReplyDelete
  2. Use Mormot - everything you need is already engineered and is open source and free. Sample 29 Is the server, add business logic classes. The client is built separately but use the same buisiness logic classes in the client side too.

    ReplyDelete

Post a Comment