#1 2019-08-12 11:22:26

gseica
Member
Registered: 2019-08-12
Posts: 8

DataSnap Rest Server to mORMot

During the last 4 years we have developed a DataSnap Rest Server application that allows other applications to send documents (invoices, orders, account statements, etc) into our Oracle ERP application, or to query 

data from our database.

Due to the well known DataSnap's stability problems, we are thinking about migrating this project to mORMot.

There are a few facts that we have to care about before taking a decision :

- The project is very big and we don't have enough time to rewrite it from zero

- There are tens of other client applications that are using now our DataSnap solution so, we have to keep the same JSon structures for exchanging data


Most of the DataSnap get... methods have JSon parameters  that allow the client applications to define different filtering criteria.

The returned Json data is based on queries  or/and Oracle stored procedures (some of the interrogations need some complex algorithms)


The update.. methods have Json parameters that describe the documents (invoices for instance).
If the received data is valid, the document is saved into the database together with some accounting registrations.


We studied some of mORmot's sample projects and it seems that mORMot's terminology is completely different from the DataSnap's terminology.


Our question is : can any one share his experience in migrating from DataSnap Rest to mORMot and give us some hints ?



Thank you

Offline

#2 2019-08-12 15:36:25

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: DataSnap Rest Server to mORMot

Perhaps mORMot method-based services are the way to migrate such project.
With method-based services you can handle in/out JSON parameters in code.
Then call the Oracle DB from the methods, re-using the existing data access code / SQL.

See also https://tamingthemormot.wordpress.com/2 … databases/
It is using interface-based services, but you may got the idea.

Offline

#3 2019-08-13 09:23:25

gseica
Member
Registered: 2019-08-12
Posts: 8

Re: DataSnap Rest Server to mORMot

Thank you for your quick reply.

Best regards.

Offline

#4 2019-08-13 10:02:34

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: DataSnap Rest Server to mORMot

To be clear:

Of course,  interface-based services are a cleaner way to write services using mORMot.

But perhaps the parameters encoding won't match the client expectations.... so in this case, method-based services are the way to go!

Offline

#5 2019-08-15 14:04:34

gseica
Member
Registered: 2019-08-12
Posts: 8

Re: DataSnap Rest Server to mORMot

Hi,

The most of the DataSnap functions in our project look like these :

function DoSomething1(DataIn : TJSonValue) : TJSonObject;

or

function GetSomething(DataIn : TJSonValue) : TJSonArray;


We can't figure how we can return a json array from a mORMot method.

Offline

Board footer

Powered by FluxBB