You are not logged in.
Just sharing a thought concluded from real-life projects:
We all know that there are two kinds of services you can define with mORMot:
- Method-based
- Interface-based (the "interface" here is the interface in Delphi/FPC)
A advantage of method-based services over the interface-based ones, is that the **compatibility** to new/old versions of clients.
If you use interface-based services, if you need to add a new parameter - oops! all clients need to be updated **otherwise the call will fail**.
But with method-based services, new versions of clients can submit new parameters while the old clients can keep working, and the server handle it according to what the incoming parameters are.
Just my 2 cents.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Note:
If you disable contract checking, and use transmission as JSON object for interface-based services (as you should for a public API), not as the default JSON array (for internal safe calls), then you can add parameters.
See for instance
TSQLRestClientURI.ServiceDefineSharedAPI()
and
TSQLRestServer.ServiceDefine(...).ResultAsJSONObjectWithoutResult := true;
Offline
Hey!
I didn't know about that, even after using mORMot for such a long time!
Well done and thanks, ab!
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
This is new for me too!
Thanks @ab and @edwinsn
Offline