#1 2021-02-27 07:45:51

mdoyle
Member
Registered: 2020-11-29
Posts: 25

mORMot2 examples

Good morning,

I really like the new design of mORMot2 and I assume it will increase the already breathtaking speed of development. It is just an amazing piece of software.
As others mentioned, the transition from mORMot1 is not that easy. So I started a couple of examples in my fork of the project.

https://github.com/martin-doyle/mORMot2 … rtin-doyle

The goals I want to accomplish are the following:

- Get the examples running with PUREMORMOT2 definition (done)
- The examples should work in Delphi 7 and FPC on Windows and Debian Linux (X86_64 server and client, ARM64 server only) (done, not yet tested on ARM64)
- Make the same use case work for different technical approaches like ORM, method based and interfaced based services (started, probably not yet correct)
- Create a best practice starting point for different scenarios like a standalone client only application, local network client server, client server on the internet. (open)

Any feedback is welcome.

Martin

Offline

#2 2021-02-27 14:10:18

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

Re: mORMot2 examples

Great work!

The more samples, the better.
And it helps us a lot to have your feedback.

Offline

#3 2021-02-28 03:56:29

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: mORMot2 examples

Great work and thanks for sharing!


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#4 2021-03-03 06:55:57

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

Re: mORMot2 examples

I have merged the samples.

Thanks for sharing.

Offline

#5 2021-03-07 05:19:37

AntonE
Member
Registered: 2012-02-03
Posts: 74

Re: mORMot2 examples

Thanks for the samples!

Testing Project04 Server&Client in Win64, Client compiles and run fine.
However trying to compile Project04InterfaceBasedServer for Win64:
In Delphi 10.4 : [dcc32 Fatal Error] F2092 Program or unit 'mormot.core.variants' recursively uses itself
In FPC 3.3.1    : mormot.core.json.pas(9217,32) Error: Wrong number of parameters specified for call to "<Procedure Variable>"

Changing said lines to :
    if not Assigned(OnMatch) or
       (not Assigned(@KeyCompare) and
        not Assigned(@ValueCompare)) then
      exit;

Compiles and run, but when sending a text msg from client app, get error:
{  "errorCode":406,  "errorText":"IExample.Add failed parsing ASample: TSample from input JSON"  }

Offline

#6 2021-03-07 06:37:02

AOG
Member
Registered: 2014-02-24
Posts: 490

Re: mORMot2 examples

Try this:

if not Assigned(OnMatch) or
    (not (Assigned(KeyCompare) or
    Assigned(ValueCompare))) then
  exit;

Offline

Board footer

Powered by FluxBB