#1 Re: mORMot 1 » mORMot 2 Release » 2022-12-04 16:51:40

mORMot 2 has still not reached release status?

#2 Re: mORMot 1 » mORMot 2 Release » 2022-09-21 18:39:14

@ab, Will it be released in EKON 26?

#3 Re: mORMot 1 » Delphi FMX Android client? » 2022-09-21 11:33:44

What would you mean by validating it?
Compiling and running the tests would be of any help at all?
I do have Delphi Professional installed and current, but as of today all my development is still D2007/Win32 focused. Working my way towards

#4 mORMot 1 » Delphi FMX Android client? » 2022-09-19 21:35:29

Replies: 15

the mORMot2 cross platform units, are compatible with Delphi FMX, for Android target?

Out of the cross platform units, is there something  else from mORMot 2 compatible with Delphi FMX android?

#5 Re: mORMot 1 » Delphi 2007 compiler hangs with mORMot2 and packages » 2021-09-06 08:45:55

ab wrote:

I have renamed the constructor as CreateEx().

Thank you! Now compiles fine

ab wrote:

Did you try to define the PUREMORMOT2 conditional?

Yes, it was the first I tried, with same result: hangs

ab wrote:

I am afraid there will be other issues with Delphi 2007 in other part of the framework.

I download and compile mORMot2 repo almost every day; no problems so far; will report whenever I find any other trouble

ab wrote:

Using packages is not the best way of having a stable solution on Delphi.

Unfortunately, I can't change that

#6 Re: mORMot 1 » Delphi 2007 compiler hangs with mORMot2 and packages » 2021-09-03 08:09:51

Hi ab,

Could you tell me if you are considering these changes?
If you are, I will wait
If you are not, I will make a patcher for me, so I can keep loading your changes through GitHub

Thank you!

#7 mORMot 1 » Delphi 2007 compiler hangs with mORMot2 and packages » 2021-08-30 12:26:48

Replies: 3

With D2007, If you put mORMot2 in a single package and try to compile it, it will hang

if you break it in a bunch of packages, some will hang when compiling


Somehow, the compiler can't handle it correctly

The only solution I've seen is changing in TRawUtf8List this declaration :

    constructor Create(aFlags: TRawUtf8ListFlags); reintroduce; overload;

with this this one:
    constructor CreateWithFlags(aFlags: TRawUtf8ListFlags);

And using the declaration with parameters in the less than one dozen places throught all the mORMot2 code

Idk if it's acceptable or not; if you think it is, I'd make a pull request with the changes

#8 Re: mORMot 1 » mORMot documentation on eBook » 2021-06-21 15:07:07

Junior/RO wrote:

@Javierus do you have a link to the .mobi or .epub version of the docs?

I'm sorry, but I can't publish it: it is ab's intellectual property

#9 Re: mORMot 1 » mORMot documentation on eBook » 2021-06-18 16:19:54

The much excellent "Calibre", it's an open source piece of art, a do-it-all tool to handle eBooks, from library handling to eBook reader sync


I browsed to the documentation page, and just downloaded it as plain html. Then droped the file on Calibre
Right clic on it, chose "Covert book",  and then the first option (don't know the english caption, but it's not the bulk one)
There I just chose one thing: on "Page Configuration" I chose "Kindle" in both "Input profile" and "output profile". It was a random decision; don't know if it's needed at all
And "OK"

There is a load of stuff you can customize, but I didn't use it

#10 mORMot 1 » mORMot documentation on eBook » 2021-06-17 19:31:28

Replies: 5

Just downloaded the current mORMot documentation mega-webpage, and converted it to MOBI format, to see if it was readable on a Kindle

To my surprise, Calibre did an excellent job, and all the internal links work on the ebook

The documentation, as an ebook, is very good; I'm going to read it all

Arnaud, thanks again for your awesome mORMot

#11 Re: mORMot 1 » mORMot2: anyone interested on runtime packages? » 2020-11-26 15:58:28

ab wrote:

What do you mean by "load a package"?
I guess you don't mean "downloading" a package from a central repository.
I guess you mean "link" the bpl and its dependencies from the path.

Delphi Help:
function LoadPackage(const Name: string): HMODULE; overload;
function LoadPackage(const Name: string; AValidatePackage: TValidatePackageProc): HMODULE; overload;

ab wrote:

Then a single exe is even faster and safer, and will use less resources than a set of bpl.
Ensure you understand what I wrote above about exe being "mapped" into RAM on demand on modern OS.

Ofcourse, I know I would get more speed and less resource usage.
So, you should ensure you understand that I might have a reason to not removing the checkmark on "Build with Runtime packages"

Yes, I understand it absolutely. And I keep the checkmark because the value it gives me is much higher than the pros of the single exe

Edit: I never use packages on the path; I always install the auto-loaded packages in the exe folder

#12 Re: mORMot 1 » mORMot2: anyone interested on runtime packages? » 2020-11-26 15:11:19

macfly wrote:

When you say you load the mORMOt package when needed, are you saying that load the mormot package dynamically, and not as runtime pakage?

I'm also a heavy user of runtime packages, wich means the only job my exe has is loading the main bpl: in my case that bpl is just a framework wich will load the appropriate app bpl's

When you start the exe:
* it might have some runtime packages wich will load automatically
* it loads dynamically the main BPL
* loading the main BPL will load automatically the needed packages
* then it will decide wich packages it must load: there is no real applicacion loaded so fa
* Sort them based on package dependencies
* Load and initialize dynamically each package (wich will load more runtime packages automatically)

Guess that's what he refers to with "loaded when needed": if you load a package that uses mormot.bpl , and it was not already loaded, then will load it

Ofcourse you could go with a system that registers packaged stuff on a bpl, and automates loading it automatically when the bpl is used, but so far I've never needed it

#13 Re: mORMot 1 » [SOLVED] mORMot2 hangs compiler under D2007 » 2020-11-26 10:59:54

* Clean D2007 install
* Clean computer
* New package
* without DCUs, .local, .identcache

it happens few, random times

But if I make a package with all three of mormot.core.mustache, mormot.db.sql,mormot.net.rtsphttp.pas, and any other units you want, it compiles fine

Following this rule and recreating the *.dpk and *.dproj on the first computer, it all works fine

So this "issue" is SOLVED

#14 Re: mORMot 1 » mORMot2: anyone interested on runtime packages? » 2020-11-26 10:42:01

D2007: removing refactoride100.bpl does not change anything

placing a good part of mormot2 units in a single package fixes all for me. The remaining units will work no matter how you do it: in that same package, or in a bunch of other packages

#15 Re: mORMot 1 » mORMot2: anyone interested on runtime packages? » 2020-11-24 21:58:01

I do need packages, as in no-go if it doesn't work inside one
Why? My only app is an ERP, where everything is in bpl's. It's heavily customizable via packages: the customers that need customizations, have a package,a bpl, wich integrates perfectly with the program, to the point you can't tell what is "native" and what is not. Form and datamodule inheritance allows to change standard behaviours, if that is needed. And so on...

In short: yes, packages have a place in this world. Perhaps not in the microservices world, but for now that's not my world anyway

#16 Re: mORMot 1 » [SOLVED] mORMot2 hangs compiler under D2007 » 2020-11-23 18:50:06

I've never used the command line compiler; at least I don't remember doing it in the last 20 years. If you paste here the exact command line you have used, I can try it here

Btw, editing the mormot.net.rtsphttp.pas from the IDE, and then closing the file, was also hanging the whole D2007 IDE

#17 mORMot 1 » mORMot2: anyone interested on runtime packages? » 2020-11-23 17:29:21

Replies: 24

I'm slicing mORMot2 on a bunch of packages, targeting the maximum division possible, at least at start. So far it worked fine, although a few lines must be changed  by hand in one unit

If anyone is interested, please drop me a line

#18 mORMot 1 » [SOLVED] mORMot2 hangs compiler under D2007 » 2020-11-23 17:25:38

Replies: 4

If you try to compile \mORMot2\test\mormot2tests.dpr, D2007 IDE compiler will hang in mormot.core.mustache.pas

It's not the project: when trying to anything that uses any of:

the D2007 IDE compiler will hang

I don't know if there are more units that hangs

If it is worth anything: investigating the problem on mormot.net.rtsphttp.pas, I found the problem related to the class field:
    fPendingGet: TRawUTF8List;
any line using it would hang the compiler, except for the declaration itsef, and fPendingGet.Free

Hope it helps

#19 Re: mORMot 1 » mORMot and the MVVM pattern » 2020-11-16 18:41:42

But the problem is the input... In MVVM, the view is bound to properties on the VM, and that binding must be bidirectional, unless it's just a report or something as that, wich is not the MVVM target
The view is expected to be codeless or as near to it as possible, and to alter the VM just through binding (and actions to a lesser degree)

#20 Re: mORMot 1 » mORMot and the MVVM pattern » 2020-11-16 15:14:24

ab wrote:

the difference between MVC and MVVM is more about marketing and actual implementation details than a real design disruption.

I don't understand sad

IMHO, MVVM is not the same as MVC;  for what I'm learning, MVVM gives a bigger decoupling than MVC: The VM should know nothing about the View. The view should be linked to the VM only through property binding and parameterless actions

I believe that the difference exists; MVVM might have started from MVC or MVP, but they are not the same

Could you please help me a bit more, to understand how to use MVVM with mORMot?

#21 Re: mORMot 1 » mORMot and the MVVM pattern » 2020-11-13 10:45:25

@ab ?

Is for real the MVVM in the documentation, or a typo?

#22 Re: mORMot 1 » Splitting a big ERP written in Delphi 7 to microservices » 2020-11-12 21:05:15

What do you do from the begin/end thread? Open and close the connection?
Does the datamodule host all the app tables and business rules?

#23 mORMot 1 » mORMot and the MVVM pattern » 2020-11-12 14:10:51

Replies: 6

Reading the documentation, it talks about MVC and MVVM
Implementing MVC with mORMot services seems clear
But... MVVM? As I understand it, MVVM is heavily based on binding properties from the View to the VM. That means any change on a View property must be transferred to the VM. And also de opposite: any change on the VM must be transferred to the View
I can not see how it can be done

Is there any example somewhere?


#24 Re: mORMot 1 » D2007: Can't compile SybCommons.pas » 2020-11-09 16:40:14

I don't know if this is right or not, but removing the SynUnicode Trim version and the overload qualifier, it compiles fine

function Trim(const S: SynUnicode): string;

#25 mORMot 1 » D2007: Can't compile SybCommons.pas » 2020-11-09 16:36:49

Replies: 2


In today's refactoring, compiling SynCommons with D2007 stops with this error:
[DCC Error] SynCommons.pas(24041): E2251 Ambiguous overloaded call to 'Trim'

The offending line is:

function TrimU(const S: RawUTF8): RawUTF8;
  result := Trim(s);  <------

#26 Re: mORMot 1 » Modularization of application with interfaces and dll (or bpl?) » 2020-10-31 07:49:14

@radexpol our app is a VCL monolith, there are no tiers: refactoring that to a n-tier cross platform is our goal

We are going for a MVVM approach there

Back to plugins: the exe just loads the main bpl, wich provides most of the erp-agnostic services: base form classes, security, automation, reporting, everything

The whole ERP is in fact a bunch of plugins that use the basic classes and services, and offer new classes and services to anyone that needs them
There are more ERP plugins providing major (ie. Manufacturing) or minor functionality, and the customer plugins, wich again can be major (ie.airport handling) or minor (ie.integration with a customer web)

All this depends heavily on sharing classes between plugins, and that is natural with BPL

I don't have any idea on how to do that without BPL. To be honest, I never had any need to restrict myself to DLL

#27 Re: mORMot 1 » Modularization of application with interfaces and dll (or bpl?) » 2020-10-30 20:47:33

You are forgetting we have bpl
I have a standard ERP, and for the few customers with non standard needs we make modules (packages) that plug in the system, using all standard stuff, and adding or overriding any functionality

I'm starting with mORMot, so I'm just making some packages with the sources, wich works fine

Drawback: when you build a new version, you need to rebuild the customer packages as well

#28 Re: mORMot 1 » mORMot 2.0 status? » 2020-08-29 19:03:52

Could you please update us when any part of mORMot 2 is production ready?

#29 Re: mORMot 1 » Totally Newbie question on SQL and mORMot » 2020-06-08 21:39:56

Thank you very much; that has helped me a lot

#30 mORMot 1 » Totally Newbie question on SQL and mORMot » 2020-06-06 20:16:59

Replies: 2

In mORMot, do you use triggers and all other SQL stuff, or you should do it in Delphi?
I'm not asking if you can do it, but if you are expected to do it

#31 mORMot 1 » mORMot2 libraries proposal » 2020-05-05 16:01:13

Replies: 1

mORMot has many useful libraries merged, and I understand mORMot2 will try to somehow break them down in diferent units

I think that maybe some libraries get "finished" much earlier than others
Is it possible to have an updated list with the "finished" ones?

As an example, I believe JSON handling will get the finished status way earlier than others

#32 Re: mORMot 1 » Revision 2.x of the framework » 2020-03-06 12:54:52

ab wrote:

@Javierus "split the project in subprojects"... in fact I was going into the opposite direction.
A lot of units will always be shared among projects.
And due to that, we have regularly a lot of problems with users having e.g. SynCommons.pas from SynPDF project and mORMot project in their path, and failing to compile.
So my idea would be to remove separate projects, and download and use mORMot as main source. If units are refactored into smaller and well-scoped units, it would be just fine to use only SynPDF or SynMustache and not the REST/ORM/SOA part.

I still advocate for this... But not replicating all the code on each repository; what I suggest (from the ignorance) is having side-by-side repositories, with "Core" repository(es) used by the other repos. It's not uncommon to see a repo that needs another repo from the same author, or even needs Spring4D or whatever else

All in a single repository, even if it's easy to use just a part of it, will scare devs. And not only newbies. (Do we still have newbies in Delphi?)

#33 Re: mORMot 1 » Revision 2.x of the framework » 2020-03-06 09:06:07

First: The blog topic has fooled some people: yesterday I was told that you were dropping Delphi and keeping only FPC.

1) Compiler versions: whatever you decide will be fine. Myself, just finished migrating from D5 to D2007, and halfway from D2007 to D10.3.3
2) Non-visual components: a must te get more users onboard
3) Spliting units: Bravo!  Right now loads of wonderful stuff is lost there
4) Spliting documentation: from mobile devices is very very difficult loading the current page; many times I just can't load it all. There is even a chinese page that uses your documentation page as demonstration for a web client library performance

Please, please, split the project in subprojects that will give both more visibility and more users. Right now I've started to use just your JSON library, but it took with it a load of unrelated stuff. Make it so you have, say, "Core", "JSON", "Mustache" and all the great stuff.

You will have perhaps 5 or 20 subprojects, that will attract developers by themselves. Each repo will get people looking for that specific stuff, and once they are onboard, it's way easier they are interested on the other stuff

I'm probably wrong, but I believe spliting and decoupling your repos will boost very much the mORMot family

#34 Re: mORMot 1 » open source project- really? » 2020-02-12 23:11:07

Standard troll behavior, of course
OpenSource defines a given software, and has nothing to say about the toolchain

#35 Re: mORMot 1 » Business rules example » 2019-12-09 17:36:06

oz wrote:

My advice is to use the ORM part as a simple data storage layer only

Now I'm begining to get it; I was absolutely lost.

Thanks for all the advices packed in your answer; will be of great help.

#36 Re: mORMot 1 » Business rules example » 2019-12-09 10:27:26

oz wrote:

Don‘t rely your business rules on TSQLRecords but on business PODOs. That‘s my advice for building complex servers based on mORMot.

I'm very grateful for your advice, thank you very much.
I've been programming Pascal for 35 years, but I'm the lowest newbie in ORM stuff; so I'm not sure I truly understand you.
Is your advice taking all the mORMot framework, but the ORM part?
Any direction on where to find some information about "Rely your business rules on business PODOs"?

#37 Re: mORMot 1 » Business rules example » 2019-12-03 17:17:08

Thanks again, AB

Somehow I missed it; now I've read and on my way to understanding the mechanics

I'm used to put my business logic on the OnBeforePost, OnAfterPost, OnBeforeDelete, and so on.
Where and how should I implement the business logic of objects?
I'm refering not just to field validation, wich currently I implement on the OnBeforePost, but also things as deletion validation (Is acceptable deleting this object?), insert validation, side effects on other objects, and so on.

#38 mORMot 1 » Business rules example » 2019-11-29 19:16:25

Replies: 6


I'm trying to understand how the bussiness rules work in the ORM.

In the case where an article affects other, how can I do it?


  TSQProductRecord = class(TSQLRecord)
    fReference: RawUTF8;
    fName: RawUTF8;
    fPrice: Double;
    fStock: Double;
    property Reference: RawUTF8 index 30 read fReference write fReference;
    property Name: RawUTF8 index 100 read fName write fName;
    property Price: Double read fPrice write fPrice;
    property Stock: Double read fStock write fStock;

  TSQLMovementRecord = class(TSQLRecord)
    fIDproduct: TRecordReference;
    fDelta: Double;
    fDate: TDateTime;
    property IDproduct: TRecordReference read fIDproduct write fIDproduct;
    property Delta: Double read fDelta write fDelta;
    property Date: TDateTime read fDate write fDate;

How could I code that Delta should accumulate on the Stock field on the linked Product?
How can I reject a Movement is saved with a non-existent IDproduct?

I have no clue, and am unable to find any info on this topic.

Thanks in advance

#39 SyNode » Is there someone out there using this? » 2019-11-19 21:16:45

Replies: 4

I mean, other than the creators.

There is no documentation and no examples; the help through the forum is scarce.

I'd like to give it a try, but looking at all that I'd not dare integrating this in my product

Please, tell me I'm wrong

#40 Re: mORMot 1 » Two question from a future mORMot'er » 2019-11-05 10:30:54

ab wrote:

Using the ORM is not mandatory.
You can use the interface-based SOA feature of the framework without the ORM.
Or the MVC/Web feature, without the ORM.

Yes, that I already know; I plan on go full mORMot over time, and I believe the ORM will be that last step, one table (or table group) at a time

ab wrote:

If your results are TDataSet, check the DataSetToJSON() method from our SynVirtualDataSet.pas unit.
It could help you exporting your TDataSet results as a RawJSON output parameter for the SOA.

Already read about it; will use.

ab wrote:

About BDE and multi-threads, you have threading options to the interface-based services. See the documentation about it.
Or you can just use a lock.

Ok, thank you very much, I believe is what I need; I'll learn it

ab wrote:

From my experiments, using ElevateDB will be slower than SQLite3.

I'm sure, but for old code compatibility, I need Locate, SetRange, FindNearest and all that. Once refactoring will free me from such code, leaving just SQL or ORM, I'll chose other database engine

Again, thank you very much

#41 Re: mORMot 1 » MVC/MVVM without ORM, is it possible? » 2019-11-05 01:32:47

Thank you for your help, ab
Since you answered me I've been reading every day the documentation and the forum, learning a lot about your exceptional work, and this trip is making me a better programmer

#42 mORMot 1 » Two question from a future mORMot'er » 2019-11-05 01:23:10

Replies: 2

I've been reading and learning mORMot stuff for a few months, although I still have not used it.

I apologize for the nonsense that I'm sure will be in (part) of my questions.

Mine is a micro business, with a long experience, but technologically stuck in year 2000 till this January.

And I'm still using Paradox under BDE; already started the transition to ElevateDB (chosen cause it is a SQL engine, but also engineered for good performance with navigational db handling)

My application is a legacy one (currently migrating from D5 to D2007), and although it does a good service to my customers, it's a clear BBM. I will follow your advice on driving Legacy to SOLID

And I have two, quite different questions:

1) I need to start with REST. AFAIK, the BDE is not reentrant nor threadsafe, so I was wondering if I could use interface or method based REST with just a single thread, one request at a time

2) Right now, all the business logic is in a few datamodules, wich are in fact Singletons, cause they are created just once, and any change on any table is channeled through those datasets. They have the business logic on the dataset events, and elsewhere on the app all datasets are just read only
The question is, Could mORMot work above them, using the Tdatasets as source?

Thank you for your patience reading this smile

#43 mORMot 1 » MVC/MVVM without ORM, is it possible? » 2019-09-19 09:11:24

Replies: 3

Hello, and excuse this newbie question. I've been trying to understand the documentation, but so far I'm quite unable to do it without geting lost.

Perhaps it's just that all the mORMot framework depends on the ORM, and it's so obvious that is taken as asserted by default.

But I'll dare to ask: Is the MVC/MVVM/REST dependent deom the ORM part?

Thank you in advance

Board footer

Powered by FluxBB