mORMot2

2025-12-10 0 349

Synopse mORMot 2 Framework

An Open Source Client-Server ToolBox aka ORM/SOA/MVC framework in modern Object Pascal

(c) 2008-2025 Synopse Informatique – Arnaud Bouchez

https://sy*n*ops*e.info – http://mORMot*.*n*et

Thanks to all Contributors!

NOTICE: This version 2 replaces mORMot 1.18 which is now in maintainance-only mode. Consider using mORMot 2 for any new or maintainable project.

Resources

You can find more about mORMot 2 in:

  • its Official Documentation (work in progress);
  • the Samples Folder;
  • the Thomas Tutorials;
  • the Synopse Forum;
  • the Synopse Blog;
  • the Source Code src sub-folder;
  • the Old mORMot 1 Documentation which still mostly apply to the new version – especially the design/conceptual parts.

To discuss about mORMot, in addition to our official forum, you can join:

  • the mORMot Telegram group;
  • the mORMot Discord server.

Those discussion groups are not managed by Synopse, but by some mORMot 2 users: thanks a lot to them!

If you find it worth using, please consider sponsoring mORMot 2 dev if you can – and even better through sharing your own commits. 🙂

Presentation

mORMot What?

Synopse mORMot 2 is the ultimate Open Source ToolBox for modern Object Pascal. It is a fully featured Client-Server ORM SOA MVC framework for Delphi 7 up to Delphi 12.2 Athenes and FPC 3.2/trunk, targeting Windows/Linux/BSD/MacOS for servers, and any platform for clients (including mobile or AJAX).

The main features of mORMot are therefore:

  • An optimized cross-compiler and cross-platform JSON/UTF-8 and RTTI kernel;
  • Complete and efficient Cryptography primitives (hashes, encryption, asymetric keys, X.509, OpenSSL);
  • A fully features Client/Server network layer (e.g. HTTP/S, WebSockets, OpenAPI/Swagger, async servers, LDAP, DNS, ACME);
  • Direct SQL and NoSQL database access (e.g. SQLite3, PostgreSQL, Oracle, MSSQL, OleDB, ODBC, MongoDB);
  • ORM/ODM: objects persistence on almost any database (SQL or NoSQL);
  • SOA: organize your business logic into REST services defined as interface;
  • Convention-over-configuration REST/JSON router, locally or over HTTP/HTTPS/WebSockets;
  • Clients: consume your data or services from any platform, via ORM/SOA APIs;
  • Web MVC: publish your ORM/SOA process as responsive Web Applications;
  • A lot of other reusable bricks (e.g. Unicode, network, threads, dictionaries, logging, binary serialization, variants, generics, cross-platform, pdf generation…).

Emphasizing speed and versatility, mORMot leverages the advantages of modern object pascal native code and easy-to-deploy solutions, reducing deployment cost and increasing ROI. It can be used:

  • to add basic ORM or Client-Server features to simple applications for hobbyists,
  • or let experienced users develop scalable service-based (DDD) projects for their customers,
  • or leverage FPC cross-platform abilities with an existing Delphi codebase, to embrace the next decades,
  • have fun and see modern object pascal challenge the latest languages or frameworks.

Sub-Folders

The mORMOt 2 repository content is organized into the following sub-folders:

  • src is the main source code folder, where you should find the actual framework;
  • packages contains IDE packages and tools to setup your dev environment;
  • static contains raw library .o/.obj files needed for FPC and Delphi static linking;
  • test defines the regression tests of all framework features;
  • res to compile some resources used within src – e.g. the static third-party binaries;
  • doc holds the documentation of the framework;
  • ex contains various samples.

Feel free to explore the source, and the inlined documentation.

MPL/GPL/LGPL Three-License

The framework is licensed under a disjunctive three-license giving you the choice of one of the three following sets of free software/open source licensing terms:

  • Mozilla Public License, version 1.1 or later;
  • GNU General Public License, version 2.0 or later;
  • GNU Lesser General Public License, version 2.1 or later.

This allows the use of our code in as wide a variety of software projects as possible, while still maintaining copy-left on code we wrote.
See the full licensing terms.

Quick Start

Compiler targets

The framework source code:

  • Tries to stay compatible with FPC stable and Delphi 7 and up;
  • Is currently validated against FPC 3.2.3 (fixes-3_2) and Lazarus 2.2.5 (fixes_2_2), Delphi 7, 2007, 2009, 2010, XE4, XE7, XE8, 10.4, 11.1 and 12.2.

Note that FPC 3.2.2 has a regression with variant late binding – use FPC 3.2.2 fixes branch instead.

On Delphi, only the Windows target is available for mORMot general units, but you can use the cross-platform clients units on all Delphi targets. FPC is a much better and consistent cross-platform compiler, we gladly support.

Please submit pull requests for non-validated versions.

Installation

  1. Get the source, Luke!
  • By cloning the repository (preferred):
    • git clone https://gi*th*u*b.com/synopse/mORMot2.git into e.g. c:\\github\\mORMot2,
    • and download and extract latest https://sy*n*ops*e.info/files/mormot2static.tgz or https://sy*n*ops*e.info/files/mormot2static.7z into c:\\github\\mORMot2\\static.
  • or as direct download of a given release (e.g. for a build script):
    • Download a Source code (zip) release from https://gith*ub.*com*/synopse/mORMot2/releases and extract it e.g. into d:\\mormot2,
    • and download and extract its associated mormot2static.tgz or mormot2static.7z file content into d:\\mormot2\\static.
  1. Setup your favorite IDE:
  • On Lazarus:
    • Just open and compile the /packages/lazarus/mormot2.lpk package;
    • and mormot2ui.lpk if needed.
  • On Delphi:
    • Create a new environment variable mormot2 with full path to your mORMot 2 src sub-folder (Tools – Options – IDE – Environment Variables), e.g. c:\\github\\mORMot2\\src or d:\\mormot2\\src depending on step 1;
    • Add the following string to your IDE library paths (for all target platforms, i.e. Win32 and Win64): $(mormot2);$(mormot2)\\core;$(mormot2)\\lib;$(mormot2)\\crypt;$(mormot2)\\net;$(mormot2)\\db;$(mormot2)\\rest;$(mormot2)\\orm;$(mormot2)\\soa;$(mormot2)\\app;$(mormot2)\\script;$(mormot2)\\ui;$(mormot2)\\tools;$(mormot2)\\misc
    • There is no IDE or UI package needed (yet).
  1. Discover and enjoy:
  • Open and compile test/mormot2tests.dpr in the IDE, and run the regression tests on your machine.
  • Browse the examples folder (work in progress) – especially Thomas Tutorials which are realistic and pedagogical.
  • Start from an example, and follow the documentation.
  • Feel free to contribute by posting enhancements and patches to this quickly evolving project.

For safety, the SHA-256 checksums of the current version of the downloaded binary files, as published in our https://sy*n*ops*e.info/files server, are available in this repository static/dev.sha256 file.

Coming From Version 1.18

Why Rewrite a Working Solution?

The mORMot framework stayed in revision 1.18 for years, and is was time for a full refactoring.

The main refactoring points tried to better follow SOLID principles:

  • Switch to a more rigorous versioning policy, with regular releases;
  • Split main big units (SynCommons.pas, mORMot.pas) into smaller scope-refined units;
  • OS- or compiler- specific code separated to ease evolution;
  • Rename confusing types, e.g. TSQLRecord into TOrm, TSQLRest into TRest…;
  • Favor composition over inheritance, e.g. TRest class split into proper REST/ORM/SOA classes – and folders;
  • Circumvent compiler internal errors on Delphi, e.g. changed untyped const/var changed into pointers, or reduced the units size;
  • Full rewrite of the whole RTTI, JSON and REST cores, for better efficiency and maintainability;
  • Optimization of the framework asm kernel, using AVX2 if available;
  • New features like OpenSSL, libdeflate or QuickJS support;
  • New asynchronous HTTP and WebSockets servers, with optional HTTPS/TLS support via Let\’s Encrypt;
  • Introduce modern syntax like generics or enumerators – but optional for compatibility.

We therefore created a whole new project and repository, since switching to version 2 induced some backward uncompatible changes. New unit names were used, to avoid unexpected collision issues during migration, or if 1.18 is to remain installed for a compatibility project.

Upgrade In Practice

Quick Steps when upgrading from a previous 1.18 revision:

  1. Note all units where split and renamed, and some breaking changes introduced for enhanced features, therefore a direct update is not possible – nor wanted

  2. Switch to a new folder, e.g. #\\lib2 instead of #\\lib

  3. Download latest 2.# revision files as stated just above

  4. Change your references to mORMot units:

  • All unit names changed, to avoid collision between versions;
  • Look at the samples to see the main useful units.
  1. Consult the documentation about breaking changes from 1.18, mainly:
  • Units refactoring (see point 4 above);
  • Types renamed in PUREMORMOT2 mode;
  • Delphi 5-6 and Kylix compatibility removed;
  • BigTable, LVCL, RTTI-UI deprecated.

下载源码

通过命令行克隆项目:

git clone https://github.com/synopse/mORMot2.git

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

申明:本文由第三方发布,内容仅代表作者观点,与本网站无关。对本文以及其中全部或者部分内容的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。本网发布或转载文章出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,也不代表本网对其真实性负责。

左子网 编程相关 mORMot2 https://www.zuozi.net/33695.html

SubSeven
上一篇: SubSeven
HikariCP
下一篇: HikariCP
常见问题
  • 1、自动:拍下后,点击(下载)链接即可下载;2、手动:拍下后,联系卖家发放即可或者联系官方找开发者发货。
查看详情
  • 1、源码默认交易周期:手动发货商品为1-3天,并且用户付款金额将会进入平台担保直到交易完成或者3-7天即可发放,如遇纠纷无限期延长收款金额直至纠纷解决或者退款!;
查看详情
  • 1、描述:源码描述(含标题)与实际源码不一致的(例:货不对板); 2、演示:有演示站时,与实际源码小于95%一致的(但描述中有”不保证完全一样、有变化的可能性”类似显著声明的除外); 3、发货:不发货可无理由退款; 4、安装:免费提供安装服务的源码但卖家不履行的; 5、收费:价格虚标,额外收取其他费用的(但描述中有显著声明或双方交易前有商定的除外); 6、其他:如质量方面的硬性常规问题BUG等。 注:经核实符合上述任一,均支持退款,但卖家予以积极解决问题则除外。
查看详情
  • 1、左子会对双方交易的过程及交易商品的快照进行永久存档,以确保交易的真实、有效、安全! 2、左子无法对如“永久包更新”、“永久技术支持”等类似交易之后的商家承诺做担保,请买家自行鉴别; 3、在源码同时有网站演示与图片演示,且站演与图演不一致时,默认按图演作为纠纷评判依据(特别声明或有商定除外); 4、在没有”无任何正当退款依据”的前提下,商品写有”一旦售出,概不支持退款”等类似的声明,视为无效声明; 5、在未拍下前,双方在QQ上所商定的交易内容,亦可成为纠纷评判依据(商定与描述冲突时,商定为准); 6、因聊天记录可作为纠纷评判依据,故双方联系时,只与对方在左子上所留的QQ、手机号沟通,以防对方不承认自我承诺。 7、虽然交易产生纠纷的几率很小,但一定要保留如聊天记录、手机短信等这样的重要信息,以防产生纠纷时便于左子介入快速处理。
查看详情

相关文章

猜你喜欢
发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务