delphi orm soa mvc sql nosql json rest mormot
DESCRIPTION
Slides published for BeDelphi 2014 Event. Create high performance Client Server ORM SOA REST MVC applications using Open Source Synopse mORMot framework and Delphi. Publish any SQL or NoSQL database content over JSON or XML: SQLite3, PostgreSQL, Oracle, MSSQL, FireBird, MongoDB. Define RESTful services using interfaces. Create MVC web applications, using Mustache templates. Running under Windows or Linux, with VCL/FMX clients on Mac OSX, Android or iOS/iPhone/iPad, or AJAX/PhoneGap.TRANSCRIPT
![Page 1: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/1.jpg)
![Page 2: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/2.jpg)
mORMot & Friends
Arnaud Bouchez
![Page 3: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/3.jpg)
Opinions Ahead
![Page 4: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/4.jpg)
Great times for us
![Page 5: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/5.jpg)
Great times for us
Delphi is Hype
Delphi + Pascal > Ruby
If you say Delphi is dead,
YOU are dead!
![Page 6: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/6.jpg)
Two Languages In One
Application Language
like Java C#
System Language
like C C++
![Page 7: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/7.jpg)
Dual Memory Management
Automatic Memory Management
COW and refcount
Manual Memory Management
Uses much less CPU/RAM
Server stability
![Page 8: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/8.jpg)
Dual Memory Management
Automatic Memory Management
COW and refcount
Manual Memory Management
Uses much less CPU/RAM
Server stability
ARC?
![Page 9: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/9.jpg)
New opportunities
New platforms
New compilers
Great communities
Third parties
Open Source
![Page 10: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/10.jpg)
Unleash your power
Decades of experience
Business knowledge
Productive tools
![Page 11: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/11.jpg)
Unleash your power
Decades of experience
Business knowledge
Productive tools
Innovative concepts
![Page 12: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/12.jpg)
mORMot & Friends
Open Source
Architecture & Design
Cross-Cutting features
DB Layer
ORM/ODM/SOA/MVC
Cross platform
Q&A
![Page 13: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/13.jpg)
mORMot & Friends
Open Source
Architecture & Design
Cross-Cutting features
DB Layer
ORM/ODM/SOA/MVC
Cross platform
Q&A
![Page 14: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/14.jpg)
Open Source
Started in 2008
3520 checkins since 2010
56 COCOMO years
![Page 15: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/15.jpg)
Open Source
Started in 2008
3520 checkins since 2010
56 COCOMO years
http://synopse.info/fossil
http://github.com/synopse/mORMot
http://openhub.net/p/mormot
![Page 16: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/16.jpg)
LOC
Code 213,000
Comments 50,000
Blanks 21,000
Total 284,000
http://synopse.info/fossil
http://github.com/synopse/mORMot
http://openhub.net/p/mormot
![Page 17: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/17.jpg)
Doc as Specs
Exhaustive
Maintained
Open Source
http://synopse.info/files/html
1800 pages of pdf
SynProject powered
![Page 18: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/18.jpg)
Test Driven
17,599,266 tests
Write the test
Fail the test
Write the implementation
Pass the test
![Page 19: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/19.jpg)
Test Driven
17,599,266 tests
Regression
Performance
Thread safety
Cross platform – Cross compiler
![Page 20: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/20.jpg)
http://synopse.info/forum
Feedback and support
Topics 2,200
Posts 13,500
Registered users 1,100
![Page 21: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/21.jpg)
Hall of fame Alexander (sha)
Alfred Glaenzer (alf)
Arnaud Bouchez
Aweste
Cheemeng
CoMPi
Damien (ddemars)
David Mead (MDW)
Delphinium
DigDiver
EMartin
Eric Grange
Esmond
Joe (jokusoft)
Jordi Tudela
Mario Moretti
Martin Suer
MChaos
Ondrej (reddwarf)
Pavel (mpv)
Pierre le Riche
RalfS
Sabbiolina
Sanyin
Sinisa (sinisav)
Sllimr7139
Vadim Orel
Win2014
Wolfgang Ehrhardt (via MPL)
![Page 22: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/22.jpg)
Hall of fame Alexander (sha)
Alfred Glaenzer (alf)
Arnaud Bouchez
Aweste
Cheemeng
CoMPi
Damien (ddemars)
David Mead (MDW)
Delphinium
DigDiver
EMartin
Eric Grange
Esmond
Joe (jokusoft)
Jordi Tudela
Mario Moretti
Martin Suer
MChaos
Ondrej (reddwarf)
Pavel (mpv)
Pierre le Riche
RalfS
Sabbiolina
Sanyin
Sinisa (sinisav)
Sllimr7139
Vadim Orel
Win2014
Wolfgang Ehrhardt (via MPL)
… YOU ?
![Page 23: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/23.jpg)
mORMot & Friends
Open Source
Architecture & Design
Cross-Cutting features
DB Layer
ORM/ODM/SOA/MVC
Cross platform
Q&A
![Page 24: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/24.jpg)
Architecture Switch
BBM → Clean
nTier → SOA
SOAP → REST
RAD → MVC/MVVM
SQL → ORM
NoSQL → ODM
OOP → SOLID
![Page 25: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/25.jpg)
BBM → Clean
Architecture?
BBM
Clean & Agile
![Page 26: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/26.jpg)
Architecture
Premature architecture
may be the root of all evil
Not looking at the big picture
is WORSE
![Page 27: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/27.jpg)
Prevalent Architecture
Big Ball Of Mud
![Page 28: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/28.jpg)
Customer Focused
![Page 29: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/29.jpg)
Pragmatic Agile
![Page 30: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/30.jpg)
nTier → SOA
Multi-Tier
SOA
![Page 31: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/31.jpg)
Multi-Tier
Three-tier architecture
![Page 32: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/32.jpg)
Multi-Tier
Four-tier architecture
![Page 33: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/33.jpg)
Multi-Tier
Logical vs Physical
![Page 34: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/34.jpg)
Multi-Tier
Logical vs Physical
![Page 35: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/35.jpg)
Service-Oriented Architecture (SOA)
![Page 36: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/36.jpg)
Service-Oriented Architecture (SOA)
Flexible set
of design principles
Inter-operable
producer/consumer services
![Page 37: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/37.jpg)
Service-Oriented Architecture (SOA)
Inter-operable
producer/consumer services
![Page 38: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/38.jpg)
Service-Oriented Architecture (SOA)
Service Composition
![Page 39: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/39.jpg)
Service-Oriented Architecture (SOA)
Loosely coupled
systems and domains
Mostly stateless
MicroServices
![Page 40: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/40.jpg)
Service-Oriented Architecture (SOA)
Implementation Independence
Platform
Location
Availability
Versions
![Page 41: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/41.jpg)
SOAP → REST
SOAP
REST
![Page 42: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/42.jpg)
SOAP
Simple Object Access Protocol
XML WSDL
Standard
Proven
![Page 43: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/43.jpg)
SOAP
Simple? Object Access Protocol
XML WSDL
Standard?
Proven
![Page 44: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/44.jpg)
REST
![Page 45: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/45.jpg)
REST
Brother of HTTP
Same Father, Roy Fielding
![Page 46: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/46.jpg)
REST
Brother of HTTP
Resource based
Using identifiers
Uniform interface
Transmission by representation
Stateless
![Page 47: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/47.jpg)
REST
Brother of HTTP
http://www.mysite.com/pictures/logo.png Image Resource
![Page 48: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/48.jpg)
REST
Brother of HTTP
http://www.mysite.com/index.html Static Resource
![Page 49: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/49.jpg)
REST
Brother of HTTP
http://www.mysite.com/Customer/1001 Dynamic Resource returning XML or JSON content
![Page 50: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/50.jpg)
REST
Brother of HTTP
http://www.mysite.com/Customer/1001/Picture Dynamic Resource returning an image
![Page 51: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/51.jpg)
REST
Brother of HTTP
http://www.mysite.com/pictures/logo.png Image Resource
http://www.mysite.com/index.html Static Resource
http://www.mysite.com/Customer/1001 Dynamic Resource returning XML or JSON content
http://www.mysite.com/Customer/1001/Picture Dynamic Resource returning an image
![Page 52: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/52.jpg)
REST
Brother of HTTP
But
REST <> HTTP
REST over any message protocol
even stand-alone REST
![Page 53: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/53.jpg)
REST Interfaces
HTTP Verbs
GET
POST
PUT
DELETE
CRUD Operations
READ
CREATE
UPDATE
DELETE
![Page 54: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/54.jpg)
REST Interfaces
HTTP Verbs
GET
POST
PUT
DELETE
SQL Statements
SELECT
INSERT
UPDATE
DELETE
![Page 55: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/55.jpg)
REST Interfaces
Verbs + URI vs
GET customer/123
POST customer
PUT order/456
DELETE order/456
Methods
GetCustomer
NewCustomer
ModifyOrder
DeleteOrder
![Page 56: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/56.jpg)
REST Content
Transmitted
by representation
XML
<Customer> <ID>1234</ID> <Name>Dupond</Name> <Address>Tree street
</Address> </Customer>
JSON
{"Customer": {"ID":1234,
"Name":"Dupond", "Address":"Tree street"
} }
![Page 57: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/57.jpg)
REST Content Troll
XML vs
Type safe
SOAP standard
Binary (CDATA)
Validation (XSDL)
JSON
Truly human-readable
Native AJAX / JavaScript
Compact (UTF-8 friendly)
Simple to implement
![Page 58: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/58.jpg)
RAD → MVC / MVVM
RAD
MVC & MVVM
SOA
![Page 59: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/59.jpg)
RAD
Our beloved Delphi
![Page 60: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/60.jpg)
RAD
Mixes UI and logic
→ Maintenance
Evolution
Test
Multi-platform
Nightmare
![Page 61: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/61.jpg)
MVC
Isolate domain logic from UI
Model
View
Controller – View Model
![Page 62: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/62.jpg)
Model
![Page 63: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/63.jpg)
View
![Page 64: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/64.jpg)
Controller
![Page 65: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/65.jpg)
MVC process
![Page 66: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/66.jpg)
MVVM
![Page 67: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/67.jpg)
MVC & SOA
View
Controller
Model
![Page 68: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/68.jpg)
MVC & Web
View
Controllers
Model
![Page 69: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/69.jpg)
SQL/NoSQL→ ORM/ODM
SQL
NoSQL
ORM
ODM
![Page 70: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/70.jpg)
SQL
De facto Standard
ACID by transactions
Relational (RDBMS)
![Page 71: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/71.jpg)
NoSQL
Not Only SQL
![Page 72: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/72.jpg)
NoSQL
Not Only SQL
Graphs
Aggregates
![Page 73: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/73.jpg)
NoSQL
Graph-oriented
![Page 74: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/74.jpg)
NoSQL
Aggregate-oriented
![Page 75: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/75.jpg)
NoSQL
Aggregate = all data in a given context
(boundaries for ACID)
![Page 76: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/76.jpg)
SQL / NoSQL
Data Modeling
![Page 77: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/77.jpg)
SQL / NoSQL
SQL
Normalization
Consistency
Transactions
Vertical scaling
NoSQL
Denormalization
Duplicated data
Document ACID
Horizontal scaling
![Page 78: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/78.jpg)
SQL
De facto Standard?
ACID by transactions
Relational? (RDBMS)
![Page 79: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/79.jpg)
ORM
Object Relational Mapping
CRUD on objects
vs
SQL on relational tables
![Page 80: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/80.jpg)
ORM
Object Relational Mapping
![Page 81: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/81.jpg)
ORM
Object Relational Mapping
By convention
By configuration
Database-First / Code-First
![Page 82: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/82.jpg)
ORM
In practice
myObject.Value := 10;
myContext.Update(myObject);
UPDATE OBJTABLE SET …
01010101001110011111
![Page 83: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/83.jpg)
ORM
Benefits
Stay at OOP level
Manage SQL flavors
Persistence Ignorance
Optimize SQL
Cache
![Page 84: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/84.jpg)
ORM
No magic bullet
Hard task
Hidden process
Legacy (tuned) SQL
Performance
![Page 85: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/85.jpg)
NoSQL
Aggregate = all data in a given context
These documents map our objects!
![Page 86: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/86.jpg)
ODM
Object Document Mapping
Aggregate = Object
Flexible Schema
Denormalized
![Page 87: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/87.jpg)
OOP → SOLID
Interfaces
SOLID
Just because you can doesn’t mean you should
![Page 88: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/88.jpg)
Interfaces
What, not how
A type that comprises
abstract virtual methods
Rely on abstraction
rather than implementation
![Page 89: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/89.jpg)
Interfaces
Abstraction is your health
Publish classes as services
Test, mock
Write SOLID code
![Page 90: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/90.jpg)
Interfaces
Abstraction is your health
Publish classes as services
Test, mock
Write SOLID code
and manage memory for you
![Page 91: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/91.jpg)
Interfaces
Abstraction is your health
Publish classes as services
Test, mock
Write SOLID code
and manage memory for you
unless zeroing weak pointers
![Page 92: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/92.jpg)
SOLID Principles
Single responsibility
Open/closed
Liskov substitution
Interface segregation
Dependency inversion
.. unleash interfaces!
![Page 93: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/93.jpg)
mORMot & Friends
Open Source
Architecture & Design
Cross-Cutting features
DB Layer
ORM/ODM/SOA/MVC
Cross platform
Q&A
![Page 94: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/94.jpg)
Cross Cutting Features
UTF-8 JSON
TDynArray
TDocVariant
Logging
Testing
Compression
Crypto
Mustache
SpiderMonkey
Uncoupled features: could be used
without the ORM/SOA/MVC framework
![Page 95: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/95.jpg)
SynCommons
UTF-8 JSON
From the ground up
With objects, records,
dynamic arrays, variants, any value
Performance and integration
![Page 96: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/96.jpg)
SynCommons
TDynArray
Wrapper to an existing dynamic array
TList<> on steroids
e.g. sorting, search,
binary or JSON serialization using enhanced RTTI if available
![Page 97: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/97.jpg)
SynCommons
TDynArray
In conjunction with records and variants:
value objects
data transfer objects (DTO)
![Page 98: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/98.jpg)
SynCommons
TDocVariant
Stores documents
objects, arrays, variants
with low overhead
natively JSON
with late-binding support
![Page 99: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/99.jpg)
SynCommons
TDocVariant var V: variant; // stored as any variant
...
TDocVariant.New(V); // or slightly slower V := TDocVariant.New;
V.name := 'John'; // property accessed via late-binding
V.year := 1972;
// now V contains {"name":"john","year":1972}
![Page 100: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/100.jpg)
SynCommons
TDocVariant V.name := 'Mark'; // overwrite a property value
writeln(V.name); // will write 'Mark'
V.age := 12; // add a property to the object
writeln(V.age); // will write '12'
writeln(V); // implicit conversion to JSON string
// i.e. '{"name":"Mark","age":12}'
writeln(VariantSaveJSON(V1)); // as RawUTF8
![Page 101: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/101.jpg)
SynCommons
TDocVariant + mORMot.pas TSQLRecordData = class(TSQLRecord) private fName: RawUTF8; fData: variant; public published property Name: RawUTF8 read fTest write fTest
stored AS_UNIQUE; property Data: variant read fData write fData; end;
![Page 102: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/102.jpg)
TDocVariant + mORMot.pas
property Data: variant read fData write fData;
We store a TDocVariant in Data
to mutate a SQL database
into a NoSQL engine
![Page 103: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/103.jpg)
TDocVariant + mORMot.pas
property Data: variant read fData write fData;
We store a TDocVariant in Data
to mutate a SQL database
into a NoSQL engine
![Page 104: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/104.jpg)
TDocVariant + mORMot.pas
var aRec: TSQLRecordData;
aID: integer;
begin
// initialization of one record
aRec := TSQLRecordData.Create;
aRec.Name := 'Joe’;
// create a TDocVariant
aRec.data := _JSONFast('{name:"Joe",age:30}');
// or we can use this overloaded constructor
aRec := TSQLRecordData.Create(
['Joe',_ObjFast(['name','Joe','age',30])]);
![Page 105: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/105.jpg)
TDocVariant + mORMot.pas
// now we can play with the data, e.g. via late-binding:
writeln(aRec.Name); // will write 'Joe'
writeln(aRec.Data); // write '{"name":"Joe","age":30}
// one year older
aRec.Data.age := aRec.Data.age+1;
// add a property to the schema
aRec.Data.interests := 'football';
aID := aClient.Add(aRec);
// we stored {"name":"Joe","age":31,"interests":"footbal"}
aRec.Free;
// now we can retrieve the data e.g. via aID
end;
![Page 106: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/106.jpg)
TDocVariant + mORMot.pas
property Data: variant read fData write fData;
Data will be stored as TEXT
in the underlying RDBMS
![Page 107: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/107.jpg)
TDocVariant + mORMot.pas
property Data: variant read fData write fData;
Data will be stored as TEXT
in the underlying RDBMS
Of course, if the database is a MongoDB engine,
the data will be stored as a true BSON document
![Page 108: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/108.jpg)
SynCommons
Logging
Low overhead
Local or remote
Fast viewer tool
Exception catch, stack trace
Used by the whole framework
![Page 109: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/109.jpg)
SynCommons
Testing
Light and cross-platform
Convention over configuration
Stubs and mocks
![Page 110: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/110.jpg)
Compression
SynZip
faster unzip
SynLZO
SynLZ
speed symmetric
![Page 111: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/111.jpg)
SynCrtSock
Cross-platform Network library
Socket WinHTTP WinINet clients
Optimized HTTP server
IOCP driven
http.sys kernel-mode
![Page 112: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/112.jpg)
SynCrypto
SHA 1
SHA 256
AES 128
AES 192
AES 256
MD5
Pascal or optimized asm
![Page 113: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/113.jpg)
SynPDF
From TCanvas to PDF
Unicode
Font embedding
Encryption
![Page 114: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/114.jpg)
SynPDF
From TCanvas to PDF
Unicode
Font embedding
Encryption
Code-based report engine
![Page 115: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/115.jpg)
SynMustache
Mustache template system
Data context as TDocVariant
UTF-8 JSON
With extensions
![Page 116: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/116.jpg)
SynMustache
Data Context { "header": "Colors", "items": [ {"name": "red", "first": true, "url": "#Red"}, {"name": "green", "link": true, "url": "#Green"}, {"name": "blue", "link": true, "url": "#Blue"} ], "empty": true }
![Page 117: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/117.jpg)
SynMustache
Template <h1>{{header}}</h1> {{#items}} {{#first}} <li><strong>{{name}}</strong></li> {{/first}} {{#link}} <li><a href="{{url}}">{{name}}</a></li> {{/link}} {{/items}} {{#empty}} <p>The list is empty.</p> {{/empty}}
![Page 118: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/118.jpg)
SynMustache
Result <h1>Colors</h1>
<li><strong>red</strong></li>
<li><a href="#Green">green</a></li>
<li><a href="#Blue">blue</a></li>
<p>The list is empty.</p>
![Page 119: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/119.jpg)
SynMustache
Data Context { "header": "Colors", "items": [ {"name": "red", "first": true, "url": "#Red"}, {"name": "green", "link": true, "url": "#Green"}, {"name": "blue", "link": true, "url": "#Blue"} ], "empty": true }
![Page 120: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/120.jpg)
SynMustache
Template <h1>{{header}}</h1> {{#items}} {{#first}} <li><strong>{{name}}</strong></li> {{/first}} {{#link}} <li><a href="{{url}}">{{name}}</a></li> {{/link}} {{/items}} {{#empty}} <p>The list is empty.</p> {{/empty}}
![Page 121: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/121.jpg)
SynMustache
Result <h1>Colors</h1>
<li><strong>red</strong></li>
<li><a href="#Green">green</a></li>
<li><a href="#Blue">blue</a></li>
<p>The list is empty.</p>
![Page 122: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/122.jpg)
SynMustache
Data Context { "header": "Colors", "items": [ {"name": "red", "first": true, "url": "#Red"}, {"name": "green", "link": true, "url": "#Green"}, {"name": "blue", "link": true, "url": "#Blue"} ], "empty": true }
![Page 123: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/123.jpg)
SynMustache
Template <h1>{{header}}</h1> {{#items}} {{#first}} <li><strong>{{name}}</strong></li> {{/first}} {{#link}} <li><a href="{{url}}">{{name}}</a></li> {{/link}} {{/items}} {{#empty}} <p>The list is empty.</p> {{/empty}}
![Page 124: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/124.jpg)
SynMustache
Result <h1>Colors</h1>
<li><strong>red</strong></li>
<li><a href="#Green">green</a></li>
<li><a href="#Blue">blue</a></li>
<p>The list is empty.</p>
![Page 125: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/125.jpg)
SynMustache
Data Context { "header": "Colors", "items": [ {"name": "red", "first": true, "url": "#Red"}, {"name": "green", "link": true, "url": "#Green"}, {"name": "blue", "link": true, "url": "#Blue"} ], "empty": true }
![Page 126: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/126.jpg)
SynMustache
Template <h1>{{header}}</h1> {{#items}} {{#first}} <li><strong>{{name}}</strong></li> {{/first}} {{#link}} <li><a href="{{url}}">{{name}}</a></li> {{/link}} {{/items}} {{#empty}} <p>The list is empty.</p> {{/empty}}
![Page 127: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/127.jpg)
SynMustache
Result <h1>Colors</h1>
<li><strong>red</strong></li>
<li><a href="#Green">green</a></li>
<li><a href="#Blue">blue</a></li>
<p>The list is empty.</p>
![Page 128: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/128.jpg)
SynSM
Latest Spidermonkey
Javascript JIT engine
Call JS from Delphi
TSMVariant for late binding
![Page 129: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/129.jpg)
SynSM
Latest Spidermonkey
Javascript JIT engine
Call JS from Delphi
TSMVariant for late binding
SynSM + mORMot = multi-threaded node.js
![Page 130: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/130.jpg)
Sample 23
![Page 131: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/131.jpg)
mORMot & Friends
Open Source
Architecture & Design
Cross-Cutting features
DB Layer
ORM/ODM/SOA/MVC
Cross platform
Q&A
![Page 132: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/132.jpg)
DB Layer
SynMongoDB
NoSQL
SynDB
SQL
Uncoupled features: could be used
without the ORM/SOA/MVC framework
![Page 133: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/133.jpg)
SynMongoDB
MongoDB native access
BSON types - TBSONVariant
TDocVariant
Extended JSON
![Page 134: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/134.jpg)
Sample 24
![Page 135: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/135.jpg)
SynDB
Direct RDBMS access layer
Not linked to DB.pas
Multi providers
UTF-8 JSON
Interface based
Knows SQL dialects
SynDBExplorer
![Page 136: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/136.jpg)
SynDB
Not linked to DB.pas
Enter the 21th century
Less data types
By-pass slow TDataSet
Unicode even before Delphi 2009
Array binding
Native JSON support
![Page 137: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/137.jpg)
SynDB
Providers
![Page 138: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/138.jpg)
SynDB
Connect to a DB
var Props: TSQLDBConnectionProperties; ... Props := TOleDBMSSQLConnectionProperties.Create( '.\\SQLEXPRESS','AdventureWorks2008R2','',''); try UseProps(Props); finally Props.Free; end;
![Page 139: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/139.jpg)
SynDB
Execute statements
procedure UseProps(Props: TSQLDBConnectionProperties); var I: ISQLDBRows; begin I := Props.Execute( 'select * from Sales.Customer '+ 'where AccountNumber like ?',['AW000001%']); while I.Step do assert(Copy(I['AccountNumber'],1,8)='AW000001'); end;
![Page 140: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/140.jpg)
SynDB
Late-binding
procedure UseProps(Props: TSQLDBConnectionProperties); var Row: Variant; begin with Props.Execute( 'select * from Sales.Customer '+ 'where AccountNumber like ?‘,['AW000001%'],@Row) do while Step do assert(Copy(Row.AccountNumber,1,8)='AW000001'); end;
![Page 141: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/141.jpg)
SynDB
TQuery emulation
Q := TQuery.Create(aSQLDBConnection); try Q.SQL.Clear; // optional Q.SQL.Add('select * from DOMAIN.TABLE'); Q.SQL.Add(' WHERE ID_DETAIL=:detail;'); Q.ParamByName('DETAIL').AsString := '1234'; Q.Open; Q.First; // optional while not Q.Eof do begin assert(Q.FieldByName('id_detail').AsString='1234'); Q.Next; end; Q.Close; // optional finally Q.Free; end;
![Page 142: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/142.jpg)
SynDB
Fast read/only TDataSet ds1.DataSet := ToDataSet(ds1, aProps.Execute('select * from people',[]));
Read/write TClientDataSet ds1.DataSet := ToClientDataSet(ds1, aProps.Execute('select * from people',[]));
![Page 143: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/143.jpg)
SynDB
Remote access via HTTP
![Page 144: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/144.jpg)
SynDB
Remote access via HTTP
http.sys based server
SynLZ compression
Digital signature
Authentication
![Page 145: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/145.jpg)
SynDB
Remote access via HTTP
Mutate SQLite3 into a
high performance Client-Server RDBMS
No library to deploy on Client side
Easy remote hosting on Server side
![Page 146: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/146.jpg)
SynDB
Remote access via HTTP
Mutate SQLite3 into a
high performance Client-Server RDBMS
No library to deploy on Client side
Easy remote hosting on Server side
![Page 147: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/147.jpg)
SynDBExplorer
Manage and request your DBs
Any supported database
High performance grid
Export to CSV or SQLite3
SQLite3 integrated
Remote server or client
![Page 148: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/148.jpg)
SynDBExplorer
![Page 149: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/149.jpg)
mORMot & Friends
Open Source
Architecture & Design
Cross-Cutting features
DB Layer
ORM/ODM/SOA/MVC
Cross platform
Q&A
![Page 150: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/150.jpg)
ORM/ODM/SOA/MVC
![Page 151: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/151.jpg)
ORM/ODM/SOA/MVC
RESTful
ORM
SOA
MVC
![Page 152: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/152.jpg)
RESTful ORM
Not an ORM
with a transmission layer
But a RESTful ORM
from the ground up
![Page 153: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/153.jpg)
TSQLRest
RESTful access
Convention over configuration
CRUD methods - Cache
Authentication – Authorization
Services
On Client or Server side
![Page 154: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/154.jpg)
TSQLRest
![Page 155: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/155.jpg)
TSQLRest
![Page 156: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/156.jpg)
TSQLRest
![Page 157: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/157.jpg)
TSQLRest
![Page 158: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/158.jpg)
TSQLRestServer
Server Storage
In-memory
SQLite3 local
External SQL
External NoSQL
Redirected
![Page 159: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/159.jpg)
TSQLRestServer
![Page 160: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/160.jpg)
TSQLRestServer
Per table redirection
![Page 161: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/161.jpg)
TSQLRestClient
Client Access
In process
Library
HTTP
Named pipes
Windows messages
![Page 162: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/162.jpg)
TSQLRest Cache
![Page 163: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/163.jpg)
TSQLRecord
Convention over configuration
TSQLSampleRecord = class(TSQLRecord) private fQuestion: RawUTF8; fName: RawUTF8; fTime: TModTime; published property Time: TModTime read fTime write fTime; property Name: RawUTF8 read fName write fName; property Question: RawUTF8 read fQuestion write fQuestion; end;
![Page 164: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/164.jpg)
TSQLRecord
Convention over configuration
TSQLSampleRecord = class(TSQLRecord) private fQuestion: string; fName: string; fTime: TModTime; published property Time: TModTime read fTime write fTime; property Name: string read fName write fName; property Question: string read fQuestion write fQuestion; end;
![Page 165: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/165.jpg)
TSQLModel
Define your data model
function CreateSampleModel: TSQLModel; begin result := TSQLModel.Create([TSQLSampleRecord]); end;
Shared on both Client and Server side
![Page 166: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/166.jpg)
Database: TSQLRest
CRUD Operations
procedure TForm1.FindButtonClick(Sender: TObject); var Rec: TSQLSampleRecord; begin Rec := TSQLSampleRecord.Create( Database,'Name=?',[StringToUTF8(NameEdit.Text)]); try if Rec.ID=0 then QuestionMemo.Text := 'Not found' else QuestionMemo.Text := UTF8ToString(Rec.Question); finally Rec.Free; end; end;
![Page 167: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/167.jpg)
Database: TSQLRest
CRUD Operations
procedure TForm1.AddButtonClick(Sender: TObject); var Rec: TSQLSampleRecord; begin Rec := TSQLSampleRecord.Create; try Rec.Name := StringToUTF8(NameEdit.Text); Rec.Question := StringToUTF8(QuestionMemo.Text); if Database.Add(Rec,true)=0 then ShowMessage('Error adding the data') else begin NameEdit.Text := ''; QuestionMemo.Text := ''; NameEdit.SetFocus; end; finally Rec.Free; end; end;
![Page 168: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/168.jpg)
TSQLRestServer
var Model: TSQLModel; Database: TSQLRestServerDB; HTTPServer: TSQLHttpServer; … Model := CreateSampleModel; Database := TSQLRestServerDB.Create(Model,'data.db3'); Database.CreateMissingTables; HTTPServer := TSQLHttpServer.Create('8080',[Database]); HTTPServer.AccessControlAllowOrigin := '*';
![Page 169: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/169.jpg)
TSQLRestClient
var Model: TSQLModel; Database: TSQLRest; … Model := CreateSampleModel; Database := TSQLHttpClient.Create(ServerIP,'8080',Model);
![Page 170: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/170.jpg)
Sample 04
![Page 171: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/171.jpg)
Sample 04
http://localhost:8080/root
http://localhost:8080/root/samplerecord
disable authentication…
http://localhost:8080/root/samplerecord
http://localhost:8080/root/samplerecord/1
![Page 172: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/172.jpg)
TSQLRestServer
External SQL var Model: TSQLModel; Props: TSQLDBConnectionProperties; Database: TSQLRestServerDB; HTTPServer: TSQLHttpServer; … Model := CreateSampleModel; Props := TODBCConnectionProperties.Create('', 'Driver=PostgreSQL Unicode';…','',''); VirtualTableExternalRegisterAll(Model,Props); Database := TSQLRestServerDB.Create(Model,':memory:'); Database.CreateMissingTables; HTTPServer := TSQLHttpServer.Create('8080',[Database]); HTTPServer.AccessControlAllowOrigin := '*';
![Page 173: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/173.jpg)
Sample 28
![Page 174: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/174.jpg)
TSQLRecord
Mapping by Convention
TSQLRecordPeopleExt = class(TSQLRecord) .. published property FirstName: RawUTF8 index 40 property LastName: RawUTF8 index 40 property Data: TSQLRawBlob property YearOfBirth: integer property YearOfDeath: word property LastChange: TModTime property CreatedAt: TCreateTime end;
![Page 175: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/175.jpg)
TSQLRecord
Mapping by configuration
Model := TSQLModel.Create([TSQLRecordPeopleExt],'root'); VirtualTableExternalRegister( Model,TSQLRecordPeopleExt,Props,'Test.People');
![Page 176: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/176.jpg)
TSQLRecord
Mapping by configuration
Model := TSQLModel.Create([TSQLRecordPeopleExt],'root'); VirtualTableExternalRegister( Model,TSQLRecordPeopleExt,Props,'Test.People'); Model.Props[TSQLRecordPeopleExt].ExternalDB. MapField('ID','Key'). MapField('YearOfDeath','YOD');
![Page 177: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/177.jpg)
TSQLRecord Change Tracking
Objects Time Machine
Database.TrackChanges([TSQLInvoice]);
![Page 178: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/178.jpg)
TSQLRecord Change Tracking
Objects Time Machine
Database.TrackChanges([TSQLInvoice]); aInvoice := TSQLInvoice.Create; aHist := TSQLRecordHistory.CreateHistory( aClient,TSQLInvoice,400); try writeln('History Count: ',aHist.HistoryCount); for i := 0 to aHist.HistoryCount-1 do begin aHist.HistoryGet(i,aEvent,aTimeStamp,aInvoice); writeln; writeln('Event: ',ord(aEvent))^); writeln('TimeStamp: ',TTimeLogBits(aTimeStamp).ToText); writeln('Identifier: ',aInvoice.Number); end;
![Page 179: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/179.jpg)
BATCH
Send all modifications at once
“Unit of Work” pattern
Array Binding or Multiple INSERT
Huge performance boost
![Page 180: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/180.jpg)
Sample 15
![Page 181: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/181.jpg)
SOA
Interface-based services
Design by contract
Factories
Instances live mode
REST UTF-8 JSON Security
Thread safety
![Page 182: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/182.jpg)
SOA
Define the contract
type ICalculator = interface(IInvokable) ['{9A60C8ED-CEB2-4E09-87D4-4A16F496E5FE}'] /// add two signed 32 bit integers function Add(n1,n2: integer): integer; end;
![Page 183: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/183.jpg)
SOA
Implement the contract
type TServiceCalculator = class(TInterfacedObject, ICalculator) public function Add(n1,n2: integer): integer; end; function TServiceCalculator.Add(n1, n2: integer): integer; begin result := n1+n2; end;
![Page 184: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/184.jpg)
SOA
Publish the contract on the Server Side
RestServer.ServiceRegister( TServiceCalculator,[TypeInfo(ICalculator)],sicShared);
Define the contract on the Client Side
RestServer.ServiceRegister( [TypeInfo(ICalculator)],sicShared);
![Page 185: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/185.jpg)
SOA
Use the service var I: ICalculator; begin I := Rest.Services<ICalculator>; if I<>nil then result := I.Add(10,20); end; var I: ICalculator; // for older versions of Delphi begin if Rest.Services['Calculator'].Get(I) then result := I.Add(10,20); end;
On both client and server sides
![Page 186: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/186.jpg)
Sample 14
![Page 187: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/187.jpg)
MVC/MVVM
Auto Generated UI
Dynamic Web Sites
![Page 188: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/188.jpg)
SynFile
![Page 189: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/189.jpg)
Web Apps
Classic MVC
![Page 190: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/190.jpg)
Web Apps
Model
View
Controller
ORM
Mustache
IMVCApplication
Classic MVC
![Page 191: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/191.jpg)
Web Apps
Model
View
Controller
MVCModel.pas
*.html
MVCViewModel.pas
Blog MVC Sample
![Page 192: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/192.jpg)
Web Apps
Implement a Controller
method name → page name
var const params → URI params
var out params → Mustache context
![Page 193: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/193.jpg)
Web Apps
Implement a Controller
procedure TBlogApplication.AuthorView(var ID: integer; out Author: TSQLAuthor; out Articles: variant); begin RestModel.Retrieve(ID,Author); Author.HashedPassword := ''; // no need to publish it if Author.ID<>0 then Articles := RestModel.RetrieveDocVariantArray( TSQLArticle,'','Author=? order by RowId desc limit
50',[ID],ARTICLE_FIELDS) else raise EMVCApplication.CreateGotoError(HTML_NOTFOUND); End;
→ /blog/AuthorView?....
![Page 194: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/194.jpg)
Web Apps
Implement a Controller
procedure TBlogApplication.AuthorView(var ID: integer; out Author: TSQLAuthor; out Articles: variant);
http://localhost:8092/blog/mvc-info
→ /blog/AuthorView?ID=..[integer]..
{{Main}}: variant {{ID}}: integer {{Author}}: TSQLAuthor {{Articles}}: variant
![Page 195: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/195.jpg)
Web Apps
/blog/AuthorView?ID=123
procedure TBlogApplication.AuthorView(var ID: integer; out Author: TSQLAuthor; out Articles: variant); begin
→ ID = 123 RestModel.Retrieve(ID,Author); Author.HashedPassword := ''; // no need to publish it if Author.ID<>0 then Articles := RestModel.RetrieveDocVariantArray( TSQLArticle,'','Author=? order by RowId desc limit
50',[ID],ARTICLE_FIELDS) else raise EMVCApplication.CreateGotoError(HTML_NOTFOUND); end;
![Page 196: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/196.jpg)
Web Apps
Mustache Data Context
procedure TBlogApplication.AuthorView(var ID: integer; out Author: TSQLAuthor; out Articles: variant); begin RestModel.Retrieve(ID,Author); Author.HashedPassword := ''; // no need to publish it if Author.ID<>0 then Articles := RestModel.RetrieveDocVariantArray( TSQLArticle,'','Author=? order by RowId desc limit
50',[ID],ARTICLE_FIELDS) else raise EMVCApplication.CreateGotoError(HTML_NOTFOUND); end;
{{ID}} {{Author}} {{Articles}}
![Page 197: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/197.jpg)
Sample 30
![Page 198: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/198.jpg)
Web Apps
Sample 30
http://localhost:8092/blog/default
http://localhost:8092/blog/mvc-info
http://localhost:8092/blog/articleView?id=99
http://localhost:8092/blog/articleView/json?id=99
http://localhost:8092/blog/authorView?id=1
![Page 199: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/199.jpg)
mORMot & Friends
Open Source
Architecture & Design
Cross-Cutting features
DB Layer
ORM/ODM/SOA/MVC
Cross platform
Q&A
![Page 200: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/200.jpg)
Server
Delphi
Win32 Win64
XE7 XE6 XE5 XE4 XE3 XE2
XE1 XE0 XE-1 XE-2 XE-3 XE-4 XE-5
FPC
Win32 Linux-x86 Linux-ARM
2.7.1 svn (2.6.4)
![Page 201: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/201.jpg)
Server
Delphi
Win32 Win64
XE7 XE6 XE5 XE4 XE3 XE2
XE 2010 2009 2007 2005 7 6
FPC
Win32 Linux-x86 Linux-ARM
2.7.1 svn (2.6.4)
![Page 202: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/202.jpg)
Clients
Delphi
Win32 Win64 OSX Android iOS
XE7 XE6 XE5 XE4 XE3 XE2
XE 2010 2009 2007 2005 7 6 5
FPC
All platforms
2.6.x 2.7.x
![Page 203: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/203.jpg)
Clients
Smart Mobile Studio 2.1
HTML5
Mobile / PhoneGap
any REST JSON Client
AJAX C# Java …
![Page 204: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/204.jpg)
Sample 27
![Page 205: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/205.jpg)
Sample 27
Project14ServerHttpWrapper
http://localhost:888/root/wrapper/
+ SMS Project14Client
RegressionTests + LogView server
RegressionTestsServer + SMS Sample 29
![Page 206: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/206.jpg)
RoadMap
Data Replication
Master / Slave
P2P
Offline mode
Event-Driven
…
http://synopse.info/fossil/wiki?name=RoadMap
![Page 207: Delphi ORM SOA MVC SQL NoSQL JSON REST mORMot](https://reader034.vdocuments.net/reader034/viewer/2022050619/5598faad1a28ab7b718b45e6/html5/thumbnails/207.jpg)
mORMot & Friends
Open Source
Architecture & Design
Cross-Cutting features
DB Layer
ORM/ODM/SOA/MVC
Cross platform
Q&A
http://synopse.info/files/pdf/BeDelphi2014.pdf