I just wanted to share a great article by Martin Fowler, about Micro Services. IMHO such "Micro Services" are the proper way of defining a SOA project, following SOLID principles. If we follow the "Single Responsibility" principle, we will define small uncoupled services, which […]
Tag - SOA
2014-10-25
Are "Micro Services" the proper way of writing SOA?
2014-10-25. Open Source › mORMot Framework
2014-10-24
MVC/MVVM Web Applications
2014-10-24. Open Source › mORMot Framework
We almost finished implementing a long-standing feature request,
introducing MVC / MVVM for Web Applications (like RubyOnRails) in mORMot.
This is a huge step forward, opening new perspectives not only to our
framework, but for the Delphi community.
In respect to the existing
MVC frameworks for Delphi, our solution is closer to Delphi On Rails (by the
convention-over-configuration
pattern) than the Delphi MVC
Framework or XMM.
The mORMot point of view is unique, and quite powerful,
since it is integrated with other parts of our framework, as its ORM/ODM or interface-based services.
Of course, this is a work in progress, so you are welcome to put your feedback,
patches or new features!
We will now explain how to build a MVC/MVVM web application using
mORMot, starting from the "30
- MVC Server" sample.
First of all,
check the source in our GitHub repository: two .pas
files, and
a set of minimalist Mustache
views.
This little web application publishes a simple BLOG, not fully finished yet
(this is a Sample, remember!).
But you can still execute it in your desktop browser, or any mobile device
(thanks to a simple Bootstrap-based responsive design), and see the
articles list, view one article and its comments, view the author information,
log in and out.
This sample is implemented as such:
MVVM | Source | mORMot |
Model | MVCModel.pas |
TSQLRestServerDB ORM over a SQlite3 database |
View | *.html |
Mustache template engine in the Views sub-folder |
ViewModel | MVCViewModel.pas |
Defined as one IBlogApplication interface |
For the sake of the simplicity, the sample will create some fake data in its own local SQlite3 database, the first time it is executed.
2014-10-08
Meet in Belgium!
2014-10-08. Synopse Company
Just a small message to let you know that I was invited, as a speaker to the BE Delphi 2014 event. This year, the sessions will focus on n-Tier development, so our little mORMot does make sense in the landscape! If you are in Belgium or in Europe, we would be very pleased to meet you there! Thanks […]
2014-09-12
Legacy code, mORMot, and database sharing
2014-09-12. Open Source › mORMot Framework
It is pretty much possible that you would have to maintain and evolve a legacy project, based on an existing database, with a lot of already written SQL statements - see Legacy code and existing projects.
For instance, you would like to use mORMot for new features, and/or
add mobile or HTML clients - see Cross-Platform
clients.
In this case, the ORM advanced features - like ORM Cache or BATCH process, see
BATCH
sequences for adding/updating/deleting records - may conflict with the
legacy code, for the tables which may have to be shared.
Here are some guidelines when working on such a project.
To be exhaustive about your question, we need to consider each ORM CRUD
operation.
We may have to divide them in three kinds: read queries, insertions, and
modifications of existing data.
2014-08-11
Cross-Platform mORMot Clients - Smart Mobile Studio
2014-08-11. Open Source › mORMot Framework

Current version of the main framework units target only Win32 and Win64 systems.
It allows to make easy self-hosting of mORMot servers for local
business applications in any corporation, or pay cheap hosting in the Cloud,
since mORMot CPU and RAM expectations are much lower than a regular
IIS-WCF-MSSQL-.Net
stack.
But in a Service-Oriented Architecture (SOA), you would probably need
to create clients for platforms outside the Windows world, especially
mobile devices.
A set of cross-platform client units is therefore available in the
CrossPlatform
sub-folder of the source code repository. It allows
writing any client in modern object pascal language, for:
- Any version of Delphi, on any platform (Mac OSX, or any mobile supported devices);
- FreePascal Compiler 2.7.1;
- Smart Mobile Studio 2.1, to create AJAX or mobile applications (via PhoneGap, if needed).
This series of articles will introduce you to mORMot's Cross-Platform abilities:
- Units and platforms;
- Generating the client code wrappers;
- Delphi / FreePascal clients;
- Smart Mobile Studio clients.
Any feedback is welcome in our forum, as usual!
Cross-Platform mORMot Clients - Delphi / FreePascal
2014-08-11. Open Source › mORMot Framework

Current version of the main framework units target only Win32 and Win64 systems.
It allows to make easy self-hosting of mORMot servers for local
business applications in any corporation, or pay cheap hosting in the Cloud,
since mORMot CPU and RAM expectations are much lower than a regular
IIS-WCF-MSSQL-.Net
stack.
But in a Service-Oriented Architecture (SOA), you would probably need
to create clients for platforms outside the Windows world, especially
mobile devices.
A set of cross-platform client units is therefore available in the
CrossPlatform
sub-folder of the source code repository. It allows
writing any client in modern object pascal language, for:
- Any version of Delphi, on any platform (Mac OSX, or any mobile supported devices);
- FreePascal Compiler 2.7.1;
- Smart Mobile Studio 2.1, to create AJAX or mobile applications (via PhoneGap, if needed).
This series of articles will introduce you to mORMot's Cross-Platform abilities:
- Units and platforms;
- Generating the client code wrappers;
- Delphi / FreePascal clients;
- Smart Mobile Studio clients.
Any feedback is welcome in our forum, as usual!
Cross-Platform mORMot Clients - Generating Code Wrappers
2014-08-11. Open Source › mORMot Framework

Current version of the main framework units target only Win32 and Win64 systems.
It allows to make easy self-hosting of mORMot servers for local
business applications in any corporation, or pay cheap hosting in the Cloud,
since mORMot CPU and RAM expectations are much lower than a regular
IIS-WCF-MSSQL-.Net
stack.
But in a Service-Oriented Architecture (SOA), you would probably need
to create clients for platforms outside the Windows world, especially
mobile devices.
A set of cross-platform client units is therefore available in the
CrossPlatform
sub-folder of the source code repository. It allows
writing any client in modern object pascal language, for:
- Any version of Delphi, on any platform (Mac OSX, or any mobile supported devices);
- FreePascal Compiler 2.7.1;
- Smart Mobile Studio 2.1, to create AJAX or mobile applications (via PhoneGap, if needed).
This series of articles will introduce you to mORMot's Cross-Platform abilities:
- Units and platforms;
- Generating the client code wrappers;
- Delphi / FreePascal clients;
- Smart Mobile Studio clients.
Any feedback is welcome in our forum, as usual!
Cross-Platform mORMot Clients - Units and Platforms
2014-08-11. Open Source › mORMot Framework

Current version of the main framework units target only Win32 and Win64 systems.
It allows to make easy self-hosting of mORMot servers for local
business applications in any corporation, or pay cheap hosting in the Cloud,
since mORMot CPU and RAM expectations are much lower than a regular
IIS-WCF-MSSQL-.Net
stack.
But in a Service-Oriented Architecture (SOA), you would probably need
to create clients for platforms outside the Windows world, especially
mobile devices.
A set of cross-platform client units is therefore available in the
CrossPlatform
sub-folder of the source code repository. It allows
writing any client in modern object pascal language, for:
- Any version of Delphi, on any platform (Mac OSX, or any mobile supported devices);
- FreePascal Compiler 2.7.1;
- Smart Mobile Studio 2.1, to create AJAX or mobile applications (via PhoneGap, if needed).
This series of articles will introduce you to mORMot's Cross-Platform abilities:
- Units and platforms;
- Generating the client code wrappers;
- Delphi / FreePascal clients;
- Smart Mobile Studio clients.
Any feedback is welcome in our forum, as usual!
2014-08-05
Returning content as XML
2014-08-05. Open Source › mORMot Framework
By default, interface-based services of a mORMot server will always
return a JSON array (or a JSON object, if
TServiceFactoryServer.ResultAsJSONObject
is
true
).
With some kind of clients (e.g. if they are made by a third party), it could be
useful to return XML content instead.
Your mORMot server is able to let its interface-based services return XML context instead, or in addition to the default JSON format.
2014-07-04
Website of the day
2014-07-04. Open Source
Just wanted to share some awesome SOA revolutionary idea, on 4th of July... You should take a look at http://devnull-as-a-service.com ! DAAS rocks! We will write certainly a native mORMot provider for this great data provider. This is another great Open Source project (full code is included).
2014-05-30
Software Design, Brook, mORMot, RAD, SOLID and OOP
2014-05-30. Open Source › mORMot Framework
We got a very instructive
discussion in our forums, with Silvio, the maintainer of the
Brook Framework.
Brook is a nice framework for writing web applications using Free
Pascal.
It comes to my mind what mORMot can offer.
We did not want to compare the features or say that one framework is better
than the other, but it appeared to me that a lot of object pascal programmers
are tied to 20th century programming model.
In fact, to embrace the potentials of mORMot, you need to switch your mind, and enhanced your RAD and OOP background, into 21th century SOLID model.
2014-04-28
Mustache Logic-less templates for Delphi - part 3
2014-04-28. Open Source › Open Source libraries
Mustache is
a well-known logic-less template engine.
There is plenty of Open Source implementations around (including in JavaScript,
which can be very convenient for AJAX applications on client side, for
instance).
For mORMot, we created the first pure Delphi implementation of it,
with a perfect integration with other bricks of the framework.
In last part of this series of blog articles, we will introduce the
Mustache library included within mORMot source code
tree.
You can download this documentation
as one single pdf file.
Mustache Logic-less templates for Delphi - part 2
2014-04-28. Open Source › Open Source libraries
Mustache is a well-known
logic-less template engine.
There is plenty of Open Source implementations around (including in JavaScript,
which can be very convenient for AJAX applications on client side, for
instance).
For mORMot, we created the first pure Delphi implementation of it,
with a perfect integration with other bricks of the framework.
In this second part of this series of blog articles, we will introduce the
Mustache syntax.
You can download this documentation
as one single pdf file.
Mustache Logic-less templates for Delphi - part 1
2014-04-28. Open Source › Open Source libraries
Mustache is a well-known
logic-less template engine.
There is plenty of Open Source implementations around (including in JavaScript,
which can be very convenient for AJAX applications on client side, for
instance).
For mORMot, we created the first pure Delphi implementation of it,
with a perfect integration with other bricks of the framework.
In this first part of this series of blog articles, we will introduce the
Mustache design.
You can download this documentation
as one single pdf file.
2014-04-18
Introducing mORMot's architecture and design principles
2014-04-18. Open Source › mORMot Framework
We have just released a set of slides introducing ORM, SOA, REST, JSON, MVC, MVVM, SOLID, Mocks/Stubs, Domain-Driven Design concepts with Delphi, and showing some sample code using our Open Source mORMot framework. You can follow the public link on Google Drive! This is a great opportunity to […]
2014-04-07
JavaScript support in mORMot via SpiderMonkey
2014-04-07. Open Source › mORMot Framework
As we already
stated, we finished the first step of integration of the
SpiderMonkey engine to our mORMot framework.
Version 1.8.5 of the library is already integrated, and latest official
revision will be soon merged,
thanks to mpv's great contribution.
It can be seen as stable, since it is already used on production site to serve more than
1,000,000 requests per day.
You can now easily uses JavaScript on both client and server side.
On server side, mORMot's implementation offers an unique concept, i.e.
true multi-threading,
which is IMHO a huge enhancement when compared to the regular node.js mono-threaded implementation,
and its callback hell.
In fact, node.js official marketing states its non-blocking scheme is
a plus. It allows to define a HTTP server in a few lines, but huge server
applications need JavaScript experts not to sink into a state a
disgrace.
2014-02-25
TDocVariant custom variant type
2014-02-25. Open Source › mORMot Framework
With revision 1.18 of the framework, we just introduced two new custom types
of variant
s:
TDocVariant
kind ofvariant
;TBSONVariant
kind ofvariant
.
The second custom type (which handles MongoDB-specific extensions -
like ObjectID
or other specific types like dates or binary) will
be presented later, when dealing with MongoDB support in
mORMot, together with the BSON kind of content. BSON /
MongoDB support is implemented in the SynMongoDB.pas
unit.
We will now focus on TDocVariant
itself, which is a generic
container of JSON-like objects or arrays.
This custom variant type is implemented in SynCommons.pas
unit, so
is ready to be used everywhere in your code, even without any link to the
mORMot ORM kernel, or MongoDB.
TDocVariant documents
TDocVariant
implements a custom variant type which can be used
to store any JSON/BSON document-based content, i.e. either:
- Name/value pairs, for object-oriented documents;
- An array of values (including nested documents), for array-oriented documents;
- Any combination of the two, by nesting
TDocVariant
instances.
Here are the main features of this custom variant type:
- DOM approach of any object or array documents;
- Perfect storage for dynamic value-objects content, with a schema-less approach (as you may be used to in scripting languages like Python or JavaScript);
- Allow nested documents, with no depth limitation but the available memory;
- Assignment can be either per-value (default, safest but slower when containing a lot of nested data), or per-reference (immediate reference-counted assignment);
- Very fast JSON serialization / un-serialization with support of MongoDB-like extended syntax;
- Access to properties in code, via late-binding (including almost no speed penalty due to our VCL hack as already detailed);
- Direct access to the internal variant names and values
arrays from code, by trans-typing into a
TDocVariantData record
; - Instance life-time is managed by the compiler (like any other
variant
type), without the need to useinterfaces
or explicittry..finally
blocks; - Optimized to use as little memory and CPU resource as possible (in contrast
to most other libraries, it does not allocate one
class
instance per node, but rely on pre-allocated arrays); - Opened to extension of any content storage - for instance, it will perfectly integrate with BSON serialization and custom MongoDB types (ObjectID, RegEx...), to be used in conjunction with MongoDB servers;
- Perfectly integrated with our Dynamic
array wrapper and its JSON serialization as with the
record
serialization; - Designed to work with our mORMot ORM: any
TSQLRecord
instance containing suchvariant
custom types as published properties will be recognized by the ORM core, and work as expected with any database back-end (storing the content as JSON in a TEXT column); - Designed to work with our mORMot SOA: any
interface
-based service is able to consume or publish such kind of content, asvariant
kind of parameters; - Fully integrated with the Delphi IDE: any
variant
instance will be displayed as JSON in the IDE debugger, making it very convenient to work with.
To create instances of such variant
, you can use some
easy-to-remember functions:
_Obj() _ObjFast()
global functions to create avariant
object document;_Arr() _ArrFast()
global functions to create avariant
array document;_Json() _JsonFast() _JsonFmt() _JsonFastFmt()
global functions to create anyvariant
object or array document from JSON, supplied either with standard or MongoDB-extended syntax.
2014-01-10
REpresentational State Transfer (REST)
2014-01-10. Open Source › mORMot Framework
As such, it is not just a method for building "web services". The terms "representational state transfer" and "REST" were introduced in 2000 in the doctoral dissertation of Roy Fielding, one of the principal authors of the Hypertext Transfer Protocol (HTTP) specification, on which the whole Internet rely.

There are 5 basic fundamentals of web which are leveraged to create REST services:
- Everything is a Resource;
- Every Resource is Identified by a Unique Identifier;
- Use Simple and Uniform Interfaces;
- Communication is Done by Representation;
- Every Request is Stateless.
2014-01-07
Some enhancements to REST routing of interface-based services
2014-01-07. Open Source › mORMot Framework
We have just committed some enhancements to interface-based service process.
TSQLRestRoutingREST
will now recognize several URI schemes,
like new root/Calculator/Add?n1=1&n2=2
alternative could
be pretty convenient to be consumed from some REST clients.
Please find here a documentation update.
2014-01-04
Domain-Driven Design: part 4
2014-01-04. Open Source › mORMot Framework

One year ago, we already made a quick presentation of
Domain-Driven Design, in the context of our mORMot
framework.
After one year of real-world application of those patterns, it is now time to
give more light to DDD.
Let's continue with part 4, which will define Domain-Driven Design as could be implemented with our Synopse mORMot framework
« previous entries - page 2 of 4 - next entries »