Is there a way to use RemObjects for the client server architecture but keep the DA schemas (or equivalent) on the client side

Is there a way to use RemObjects for database access but maintain the database schemas in the client source?
Our current approach is server side DA schemas but this is a bottleneck for VCS/team development. Development without constant server changes would also mean faster development for us. The data model can be shared client code for example.

I saw a sample which I believed was client code in another post

I do not find these kind of samples in my installed remobjects sample code however.
Where does your code example (see below) come from?
Do you have a fully working example for this?
My main focus is .NET RO client to .NET RO server communication but a solution also allowing delphi RO client is a plus.

var query = from x in dataModule.**DataAdapter.GetTable<Orders>**() select x;

Hello

Schema is by definition a server-side entity. It is set of definitions describing how to convert client-sent requests to database queries.

During the development cycle you can either use Relativity Server as data source or create your own custom server application that would load .daSchema file on startup (or even to reload that file every, say, 5 minutes). So the development cycle would look like this:

  1. You change the .daSchema file
  2. You continue to work on the client code
  3. Server app reloads the .daSchema file and uses the updated Schema

Same server can provide data for both .NET and Delphi clients (and even to iOS, Android or Mac clients)

If needed, you need to first read what is the LINQ and how to use it. This is quite a big topic by itself: Language Integrated Query (LINQ) in C# - C# | Microsoft Learn

Then take a look at this article: DA LINQ (.NET)

And then go over this tutorial (it accesses a Relativity Server data source from a WinForms application using DA LINQ): ToDo List Tutorial (Windows Forms)

Regards

Hi,

Can you elaborate on this server app reloads the .daSchema?
I found documentation about it here How to Dynamically load DA Schema while server is running? (Delphi Win32) - #7 by scherb
Which class has this LoadFromFile function which I can give a .daSchema?
and how can I access/configure this class from/on my RemObjects.DataAbstract.Server.DataAbstractService?

Hello

Sample application:

SchemaAutoReloadServer.zip (50.3 KB)

Points of interest:

  1. DataService: The BeforeFindServiceSchema event used to provide custom Schema instance
  2. SchemaWatcher.cs - 2 classes, one reloads Schema if it seems to be changed ( SchemaLoader ), another class is the one that triggers the reload process and provides Schema (either current one or reloaded one) to the data service (‘SchemaProvider’)
  3. The way used to wire Schema Watcher, Schema Provider and Dara Service together ( Dependency Injection support (.NET) ) :

			var schemaLoader = new SchemaLoader("SchemaAutoReloadDataset.daSchema");

			var container = new SimpleContainer();
			container.RegisterSDK(server.NetworkServer);
			container.RegisterDataAbstract();

			container.RegisterSingleton<ISchemaLoader>(schemaLoader);
			container.RegisterSingleton<ISchemaProvider, SchemaProvider>();

			container.RegisterServices();

			server.DependencyResolver = container;

When run, the server app check the “SchemaAutoReloadDataset.daSchema” file for changes and reloads it if needed, deserializes Schema from this file and provides this Schema to the Data Service

Regards

I have implemented this and this works.
I have one additional question. Can I generate the strongly typed delphi source files (from commandline) based on the daschema file?
FYI: I don’t see the option in the DA Schema Modeler either

TIA,
Frederic

Hi,

You can generate the strongly typed delphi source files from popup menu of TDASchema component in Delphi IDE.

If you need a console app - just create it by yourself.
use this method from uDASchemaUnitsGenerator.pas:

procedure GenerateSchemaUnits(aSchema : TDAClientSchema);

The first option is too tedious.
I have noticed I have to reload the schema file each time.

I will investigate the second

When I try to build the code beneath I get error

Unit ToolsAPI not found (from uDAClientSchema.pas)

program generatestronglytypeddelphsource;

{$APPTYPE CONSOLE}

{$R *.res}

uses
System.SysUtils,
uDASchemaUnitsGenerator;

procedure createstronglytypeddelphsource();
var
aSchema:TDAClientSchema;
begin
try
aSchema:=TDAClientSchema.create();
GenerateSchemaUnits(aSchema);
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;

begin
createstronglytypeddelphsource();
end.

FYI: Including C:\Program Files (x86)\Embarcadero\Studio\21.0\source\ToolsAPI in the search path gives an error on the DockForm unit (which I do not have on my filesystem)

Hi,

try it: testcase.zip (5.8 KB)

I cannot build testcase.
When trying to build it complains about firedac and other components I do not have installed.
When I strip the .dproj it still gives a fatal error “Required package ‘ibxpress’ not found”
I do not find this in the dproj or code. I do not find a UserTools.dproj (i thought this might be the cause)
I don’t know where this dependency comes from
I have attached my reduced .dproj
FYI: I am testing on XE10.4.0
Project6.zip (2.0 KB)

Hi,

looks like Delphi IDE added some extra packages at saving.
only one package is required: DesignIDE:

Project6.zip (2.4 KB)

This works perfectly, thanks