The Server Project Generated by the Data Abstract New Project Wizard (.NET)
(This page is considered "good" on a technical level, but is pending review for grammar and typos)
Server application project optionally created by the New Project wizard is a fully functional Data Abstract server application. Generated project contains all necessary components and can be used as is, without any adjustments, or be used as a basis for more advanced server application.
Right after being generated server application provides following features:
- Fully functional Data Abstract server
- Optional OData and Business Rules Scripting API support
- 3 application run modes - GUI mode (WinForms or WPF), command-line interface or Windows Service
- Windows Service manafement (installation/deinstallation)
- Single Instance check
- Startup arguments parser
- Single exception intercept point (useful for logging etc)
Server based applications recognizes following command-line arguments (not case-sensitive):
|-I, /I, --INSTALL||Install service|
|-U, /U, --UNINSTALL||Uninstall service|
|-Q, /Q, --QUIET||Suppress messages on service installation and uninstallation|
|-C, /C, --COMMANDLINE||Run in CLI mode|
|-D, /D, --DEBUG||Request extended debug info (ie full stacktraces)|
|-H, /H, -?, /?||Show command-line arguments help message|
This article describes server application components.
Server application project as a WinForms application that can be run as ordinal application with GUI, with command line interface or as Windows Service or Mac OS X/Linux daemon.
Newly generated server application project contains following components:
|App.config||Ordinal .NET application configuration file. Needed to explicitly allow to load .NET Framework 2.0 or 3.5 assemblies into .NET Framework 4.0+ application|
|.daConnections file||Contains underlying database connection parameters. Please note that this file contains database connection parameters, including username and password.|
|.daSchema file||Server Schema definition. Contains information about mapping physical database tables into logical Schema tables exposed to the client applications.|
|RODL file|| Contains definitions of all remote services exposed by this Data Abstract server.
This file is used to generate Invoker and Interface code files.
|_Intf and _Invk files||Invoker and Interface code files generated based on the server RODL file|
|DataService_Impl file||Auto-generated implementation of the Data Abstract data access service|
|LoginService_Impl file||Auto-generated implementation of the Data Abstract user authentication service|
|Engine||Server engine. This component contains all server components needed for an Data Abstract server|
|MainService||Class that defines Windows Service that will host this Data Abstract server if needed (ie if the server application will be run as Windows Service or Unix Daemon)|
|ProjectInstaller||Class that provides functionality needed for Windows Service management tools (ie service installation and uninstallation)|
|MainForm||Main server form. You might consider to change its ancestor class to ServerBaseForm class that provides more GUI functionality like tray icon with context menu.|
|licenses.licx||Plain-text list of classes that require license to be provided. This file is used at build time by the license compiler to build and embed into the resulting assembly needed licensing information|
|SampleServer.cs||This code file contains application server definition class inherited from the ApplicationServer class|
Most important application components are described in more details below
Ordinal .NET application configuration file. Needed to explicitly allow to load .NET Framework 2.0 or 3.5 assemblies into .NET Framework 4.0+ application.
<? xml version =" 1.0 "?> < configuration> <!-- if you don't use SQLite database, the you can remove this file from project --> < startup useLegacyV2RuntimeActivationPolicy =" true "> < supportedRuntime version = "v4.0 " sku = ".NETFramework,Version=v4.0 " /> </ startup> </ configuration>
This is the recommended place to store application settings, connection strings etc. Please refer to [MSDN article] for more details.
.daConnections and .daSchema files
RODL file and Invoker and interface files
If the Service Builder was launched via dbl-click on the RODL file in solution explorer then Invoker and Interface files will be regenerated automatically to reflect all changes made to the RODL. Otherwise developer have to generate interface and invoker code using Service Builder Codegen menu and paste that code into the appropriate files manually.
Note that in most cases there is no need to add any custom methods to the DataService and LoginService definitions.
Data Access Service and Login Service implementations
Data Access Service implementation is generated automatically and can be used AS IS.
At the same time one has to re-implement the Login method of the Login Service.
This method should call code that checks user credentials and performs authentication procedure. Authentication code generated by default is very simple and accepts any user credentials where user name and password match.
This component contains the very heart of the Data Abstract server.
It contains the network connectivity components responsible for data transfer over the wire, session management component and connection manager:
This is classical Windows Service definition class. Please take a look at ist code-behind file where server startup and shutdown procedures are implemented.
This is another classical Windows Service-related component. This component is responsible for Windows Service install and uninstall procedures and doesn't contain any Data Abstract-specific code
Note: Name of this code file matches server project name and might differ for your projects.
This code file contains application server definition class inherited from the ApplicationServer class.
The ApplicationServer class is a helper class that provides easily extensible way to create application servers that can be run as Windows Service, WinForms application, console application or Unix Daemon with just a dozen or two lines of code. This class is used not only in server application created by the New Project Wizard - the Relativity Server, Olympia State Server and RO ZeroConf Hub use ApplicationServer descendant class as well to perform startup procedures.
The New Project Wizard creates fully functional and easily extensible Data Abstract server application.