Coding a Custom DA Server for Mono/.NET (Beta 9) in Fire - Is it possible? How?

My goals:

  • Custom DA Server written in .NET and compatible with latest Mono
  • Add some custom services using RO SDK/Remoting (basically a proxy to some other services that expose proprietary REST API, and that I don’t want to expose directly to clients)
  • Use the latest Beta 9 for both DA and Remoting (want to use Code First)
  • Code all of these preferably on Mac OSX using Fire or MonoDevelop (or whatever?)
  • Deployed services will run on Ubuntu boxes under latest Mono

Now, I’m fine with starting a new project skeleton using Visual Studio under one of my VMs, but as I plan to use Vagrant with VMWare Fusion under OSX host, I’d like to perform building and code tweaking under OSX as well, without continually switching to the Win VM…

Does Fire include support for building custom DA servers?
I’ve just installed and configured everything (including DA plugin) but I can’t see any project skeleton to start with coding a DA Server (disclaimer: total RemObjects newbie here, never seen a working DA solution yet).

As a side question: are there other viable options to code custom DA and Remoting services to run under Linux?

Thanks for your support,
P.

It’s doable, but we don’t currently have a project template in Fire. I’ll see if I can write up some steps for you tomorrow, or send you a skeleton project. If you have access to a Windows machine, the easiest way might be to just start the new project there in VS and then copy it over for further development in Fire.

Sorry for having read your original message a bit diagonally and missing some aspects, when first replying.

Really, there’s two issues you’ll run into with developing a Custom DA server on Mac.

The first, as discussed, is the lack of template in Fire (the reason for which is tied to the second issue below). As you already suggested, the easiness workaround is to start a new project in VS and then switch over to the mac to maintain it, which should work fine, especially if you develop your new server using the Code-First model (which the DA template doesn’t provide (yet), but can be easily converted to afterwards, see Converting a Server to Code-First).

Once you have a Code First server project, you can open it in Fire and works with it there, including adding new and modifying existing services. (if you don’t go Code-First, you’d need Service Builder, which is Windows only. But Code-First is the future, anyways).

So, this template issue we could (and might) easily fix for a future Fire beta; the reason we haven;t lies in issue #2:

The second issue is that on addition to working on your server code and services, maintaining a custom DA server also involves editing your Schema(s). Unfortunately, editing stand-along schemas is not currently supported in Schema Modeler for Mac (and probably wont be any time soon, for many technical reasons, mostly related to how doing so (a) requires .NET/Mono and/or Delphi code to run in Schema Modeler and (b) depends on various database drivers to be installed/available on your Mac. Because that’s tricky, DASM/Mac currently only supports editing Schemas in Relativity Server (where the heavy lifting, running the actual DA/.NET database code, is done in the server, and DASM/Mac only provides the UI.

There’s only two solutions for this:

(1) go back to Windows and DASM7 when you need to edit your schema. That’s of course doable — but you specifically asked about not having to use Windows, a sentiment i can understand ;).

(2) run a copy of Relativity Server, with your Schema(s) inside, and use DASM/Mac and Relativity to edit them. After you make changes, do “Save As” in DASM/Mac to save a local copy the schema and update the schema(s) in your project with it.

.NET-based RO and DA servers should and do run fine under Linux, with Mono (assuming availability of the database driver(s) you need).

i hope this helps explain things; please do not hesitate to ask if you have more questions.

yours,
marc

1 Like

Thank you Marc for your thorough explanation, really appreciate it.

I’ll try to implement a complete test solution starting tomorrow, and I’ll report back the outcome ASAP…

Regarding the DB driver, in your experience every ADO.NET driver fully certified to work on Mono is good for DA, or it depends on other factors?
I’m planning to use Postgres 9.4 (or 9.5), and there are third party ADO.NET providers that promise greater performance than OSS ones… Are they worth trying, or better to stick with NPGSQL?

yours,
Paolo

PostgreSQL definitely works well on Mono/Linux — we use that combo for a lot of our own internal services. Pretty sure I’ve successfully used it on Mac when running servers for debugging, as well.

Hi,
is there any state-of-the-art example demonstrating a custom DA server written in .Net (Mono)? Ideally with deployment demonstrations, like how to properly deploy a linux daemon.
Digging through the Samples directory on my win box gives me the impression that the answer is no, but maybe you have some complete tutorial with code posted somewhere…

As a side note, I personally find the new/old wiki coexistence confusing (to say it politely…), and it’s really really hard to find the needed info!
For example, I started from here http://docs.dataabstract.com/NET/GettingStarted/, and soon I realized that both the “Read Article” links are missing! Where are that articles?

Thx,
P.

I do believe we ship the custom PCTrade sample server with DA/.NET. I’ll chekc wiht the team to make sure, as i don’t have access to a Windows VM right now (and, yeah, we don’t ship any samples in the “DA for Fire” distro, an issue, i,m aware of).

I don’t believe we have a tic covering this, but i agree we need one. making a note. Essentially, you can run a RO server with the “--commandline” switch from the console, or you can install/tun it with as a true deamon with the mono-service tool.

i hear you. I’ll check with the team to see where we are with getting the new docs site more complete in this area, for DA. I’m also vastly reworking tire RO-level docs, myself, at http://docs.rosdk.com, which is where eu’ll make sure the above deployment topic will get written.

thanx!
marc

There are 2 PcTrade directories under DA samples (PCTradeOffice and PCTradeMobile), but neither of these seems to implement a custom DA Server…
Every sample I checked seems to concentrate mostly on clients, communicating with Relativity server.

Hello

Please take a look at the attached Server project: DataAbstractServer.zip (64.1 KB)

This is a fully functional Data Abstract for .NET server implemented in 3 code files and 3 resource files (compared to more than a dozen elements used earlier). Let’s take a closer look at them:

  1. Program.pas - this is the program entry point. The ApplicationServer class used is the one that allows all the program startup options, configuration loading etc (more on this later).
  2. LoginService.pas - login service implementation. You’ll need to adjust this service to perform proper user authentication.
  3. DataService.pas - a very minimal Data Abstract’s data access service implementation.
  4. Properties/licenses.licx - text file that contains information about components used. Requred by the .NET licensing system
  5. DataAbstractServer.daSchema - Schema itself. Currently contain table definitions from the sample PCTrade base.
  6. DataAbstractServer.daConnections - Connection definitions.

The only step required to get this server up and running is to adjust the schema and connections using the Schema Modeler.

The next message will cover deployment options.

Deployment
The server app supports so-called x-copy deployment. This means that server assemblies can be just copied to the target host.

Build the app in Release mode and copy the following assemblies:

  • DataAbstractServer.exe
  • DataAbstractServer.exe.config
  • RemObjects.Elements.Dynamic.dll
  • RemObjects.InternetPack.dll
  • RemObjects.DataAbstract.dll
  • RemObjects.DataAbstract.Server.dll
  • RemObjects.SDK.dll
  • RemObjects.SDK.Server.dll
  • RemObjects.SDK.ZeroConf.dll
  • RemObjects.SDK.ZLib.dll

The application provides the following features:

  • 3 application run modes - GUI mode (WinForms), command-line interface or Windows Service
  • Windows Service management (installation/deinstallation)
  • Single Instance check

Start the app with the /? or -h switch and it will show the available startup options.

On Mono the server app can be run as a simple commandline app or as a daemon isung the mono-service tool.
Commandline app:

mono DataAbstractService.exe --commandline

Daemon

mono-service DataAbstractService.exe

Such daemons can be also auto-started on system startup ( MattDeBoard.net )

Hi
several months are passed, and today I downloaded the latest beta version of Fire app on macOs…
I have deleted my old fire installation (that I never used due to its initial limitations), and logged in with my credentials, then I installed the latest DataAbstract fireplugin (the alpha one, just to be cutting edge…).

Now I can find a Remoting SDK Server project template, but nothing regarding a DataAbstract template…
So to revive my old question: How am I supposed to start a new DA custom server project from scratch on macOS?

I reiterate that I don’t want to develop on windows anymore…
I might have taken the wrong decision in buying a DA license, as I abandoned windows development more than a year ago, but I hoped to be able to develop a complete API server on macOS using C# (ideally not on Mono, but on .Net Core, but I know it’s too early to dream that…).
I don’t have time/resources to grasp a new language today (Oxygene) and my Delphi background is dated back to v2.0 on win3.1, so I want complete tutorials/demos and reference docs written for C#…

Regarding documentation… Well that’s really a pain point! This is the link that should guide me on using Fire to develop DA projects: https://docs.dataabstract.com/IDEs/Fire/
It’s what I call “a placeholder”, just to avoid a completely blank page, but its entropy is the same: close to zero!

I see your product have a potential, but without proper documentation it becomes useless for newcomers, and devs like me with short time-frames (that is someone not willing to do a lot of trial-and-error iterations or digging through your source base to compensate the lack of proper docs).
I put a lot of effort in documenting my solutions, and I expect the core software/libraries I use do the same.
If I could ask for a refund, even after seven months since I bought a license, I’ll likely ask for it now… For sure I’m not going to buy a renewal at the end of the subscription, especially if this lack of documentation is “endemic” in your products…

Sorry for my rant,
P.

I’m afraid the story for developing custom DA servers on Mac is a bit complicated, mostly due to the lack to a local Schema Modeler w/ database device drivers for Mac (Schema Modeler 7 is Windows only, and Schema Modeler for Mac supports only connections thru Relativity server and modeling Schemas that way, it, being a Mac app, does not come wit or have access to Data Abstract database drivers directly.

So the short story still is: you can create a custom DA Server project via the VS template, or by hand, and then work on the code for that project in Fire. But you will need a Windows PC or VM in order to edit the Schemas for your custom swerved.

I do apologize about the missing links in the DA docs, with regards to Fire. Those three topics unfortunately have not been written yet, the root page has been created in parallel with https://docs.remotingsdk.com/IDEs/Fire/, the Remoting SDK version, but the actual topics are not done yet (that said, the three menu items for those tasks after in current Fire, and should work, and should be pretty self-explanatory).

We’re continually improving DA, Fire/Elements and the docs, and those topics too will be written eventually. In the meantime though., I’m afraid out sort term plans do not include any option to design schemas for custom DA servers on the Mac, as that would require a substantial rewrite for DASM/Mac tat currently, frankly, there is not much demand for (most users working on Mac-only are using Relativity, which is our recommended approach).

Thanx for understanding.,
marc