File Generated from RODL
Remoting SDK automatically generates several source code files from your RODL files, in order to make the types and services defined therein available to your project at compile time.
The benefit of this is that you can use strongly typed code to call your service and work with your types, giving you Intellisense and Code Completion as you type your code, and compiler validation as you build your project.
How and when these source files will be generated depends on the IDE and the edition of Remoting SDK you are using, as discussed further below.
File Types
There are 5 types of source files that Remoting SDK generates from your RODL file. These files can be generated in all supported languages, including C#, Oxygene, Delphi, Objective-C, Java, JavaScript and Visual Basic.
Type | Description |
_Intf files | One Interface file will be generated for each RODL, containing definitions for all the types defined in the RODL, the interface definitions of all the services, and client-side proxies for all the services. Under normal circumstances, the Intf file is the only file that will be needed on the client. |
_Impl files | One Implementation file will be generated for each service defined in the RODL, containing a stub implementation for the service. Once generated, an Impl file will never be overwritten, as the Impl file will be filled by the developer with the actual code to implement the service. |
_Invk files | One Invoker file will be generated per RODL, containing server-side stubs used to invoke the service methods. These stubs are used internally by the framework, and it's very unlikely that you will ever have to deal directly with it. |
_Events files | One Events file will be generated for each RODL that contains event sinks. The file will contain the proxy code that will be used on the server to fire events. Events files are only generated by Remoting SDK for .NET; in the Delphi edition, the Interface file is used for these types. |
_Async files | One Async Interface file can be generated for each RODL when needed. The file will contain the proxy code that allows service methods to be called in an asynchronous fashion; please refer to the Asynchronous Calls topic for details. |
Note that all files except the Implementations will be automatically regenerated by the IDE whenever needed, so you should not make any custom modifications.
Generating Files Inside the IDE (Delphi & .NET)
There are two scenarios where the IDE will generate source files from RODL for you automatically and add them to your project. When you're building a Remoting SDK Server, your project will contain a RODL file and a complete set of files (_Intf
, _Invk
, _Impl
and possibly _Events
) will be generated for your project. In the Delphi edition, these files will be generated whenever you build your project; in the .NET edition this will happen whenever you edit your RODL library from within the IDE. In both editions, the Remoting SDK Menu will provide an option to regenerate the files on request, if a server project is active.
As mentioned above, the _Impl
files that contain the implementation of your services will only be generated the first time around - once the file exists, it will not ever be overwritten.
When you're building a Remoting SDK Client, you have two options for obtaining interface code for your server. If you have access to the server source-code and the server is implemented in the same language, you can simply reference or copy the _Intf
file from the server. Otherwise, you can use the Import Service item of the Remoting SDK Menu to import a service, either via the network or from a local RODL file. During this import, a _Intf
source file will automatically be generated in the proper language, and added to your project.
Generating Files on OS X
On Mac OS X, generating the files is done outside the Xcode IDE using the rodl2objc tool.
Source files can be generated in one of two ways, either by opening the RODL file in the tool, selecting the required language from the Language dropbox and then pressing Save.
Alternatively you can generate the source files from an instance of Relativity by choose the appropriate Service from the Services menu.
Generating Code for Other .NET Languages
For .NET, code generation is accomplished using CodeDom, so that support for other third party languages can be accomplished with some minimal code, if these languages provide a full CodeDom implementation. The RODL Sample, included with Remoting SDK for .NET, shows how to do this as an example of using the C#, Visual Basic and Oxygene CodeDoms from custom code.