Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 12 of 12 total
Thread EWB and mORMot using ewbmormot.wbs
Mon, Nov 19 2018 8:18 PMPermanent Link

erickengelke

Avatar

Robert Horbury-Smith wrote:
>Just on the size and complexity of the wrappers, would it make sense to split them? (one for CRUD operations and another one for security and authentication).

In a production database, you don't usually want to do pure CRUD from the GUI, like you wouldn't want any customer to view all customers or write to them or delete them.    Likewise, you wouldn't let all employees see all employee records, or worse, delete them if they dislike someone.

Instead you would hide database ops into business logic, so the customer would converse with the business server and it would convert user requests into CRUD operations - allowing people to do just up to the limits of what you allow them.

So I use mormot as middle-ware, which accepts JSON requests from the client, does the CRUD as needed, and imposes our business logic on the database.

The name for transfering the JSON has varied over the years.  RPC (remote procedure calls) were in vogue at one time  - which makes sense because you are writing a subroutine which executes on the server.  Remote transaction is another name and it stresses how the operations are a transaction and thus atomic as far as the user is concerned.  At some point the names service oriented architecture or SOA  got added.  Try to talk SOAP and you are going too far, I don't think anyone has ported SOAP to EWB.  

In my Enterprise Delphi Datbaases book I give an example where you use an RPC to add two numbers.  Well obviously JavaScript can add, but the  goal was to show that you could pass a number of parameters in which would be sufficient for a CRUD operation.

Erick
EWB Programming Books and Component Library
http://www.erickengelke.com
Tue, Nov 20 2018 7:37 PMPermanent Link

erickengelke

Avatar

Robert Horbury-Smith wrote:

> HUGE thanks for doing this Erick.

I've got a simplified example of my current code working which shows the functionality of EWB+mormot.

It's still a bit complicated because it has to have IIS and either MySQL or Maria DB installed because it's not a trivial example.

The download is BIG, 33MB I think. The core enterpisesample.dpr is 500 lines, but not too hard.

http://www.erickengelke.com/ewbmor3sample.zip

Erick
EWB Programming Books and Component Library
http://www.erickengelke.com
« Previous PagePage 2 of 2
Jump to Page:  1 2
Image