#1 2014-11-06 00:36:33

sergioschel
Member
From: Brazil
Registered: 2014-10-23
Posts: 9

CRUD Desktop Delphi

Hi ab!

This is my first post on the forum and the first doubt. smile

I'm creating a MVC project with mORMot ...

On the client side i have multiple screens of the type CRUD:

1- Create TSQLHttpClientWinHTTP for each CRUD only with TSQLModel table used?

2 - Create TSQLHttpClientWinHTTP only once for all the project with TSQLModel creating all tables?

What is better?

Thanks,
Sergio Schelbauer

Offline

#2 2014-11-06 08:33:53

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

Re: CRUD Desktop Delphi

The best is to create one single client instance, which would be used from the UI thread.

What is mandatory, in the mORMot way, is to share the same data model on both client and server sides, with the same tables in the same order on both sides.
This is why we usually put all TSQLRecord in a shared unit, with no dependency on the server or client part.
Then define a single function to create the same TSQLModel on both sides.
See e.g. https://github.com/synopse/mORMot/blob/ … CModel.pas
and https://github.com/synopse/mORMot/blob/ … leData.pas

Offline

Board footer

Powered by FluxBB