4.2 Step 2: Creating the .Net assemblies

Before you can start creating your new projects you need to download the SDK and setup your development environment. Please follow the instruction given here: What should OpenMI 1.4.0.0 developers install

The next step is to create the wrapper classes (Figure 8).


Fig 8. C# wrapping classes

You should create one assembly for your wrapper classes and it is strongly recommended that you also create one assembly for the corresponding test classes.

You can use the following naming conventions for your wrapper assembly:

Assembly name: MyOrganisation.OpenMI.MyModel.Wrapper
Assembly DLL name: MyOrganisation.OpenMI.MyModel.Wrapper.dll
Namespace: MyOrganisation.OpenMI.MyModel.Wrapper
Class names: MyModelEngineWrapper, MyModelEngineDotNetAccess, MyModelEngineDLLAccess, MyModelLinkableComponent

Naming conventions for the test assembly:

Assembly name: MyOrganisation.OpenMI.MyModel.Wrapper.UnitTest
Assembly DLL name: MyOrganisation.OpenMI.MyModel.Wrapper.UnitTest.DLL
Namespace: MyOrganisation.OpenMI.MyModel.Wraper.UnitTest

Class names: MyModelEngineWrapperTest, MyModelEngineDotNetAccessTest, MyModelEngineDLLAccessTest, MyModelLinkableComponentTest

To the wrapper assembly, add the following references:

OpenMI.Standard
Oatc.OpenMI.Sdk.Backbone
Oatc.OpenMI.Sdk.Wrapper

To the test assembly, add the following references:
OpenMI.Standard
Oatc.OpenMI.Sdk.Backbone
Oatc.OpenMI.Sdk.Wrapper
NUnit.framework
MyOrganisation.OpenMI.MyModel.Wrapper

Note that if you have changed the namespace names for the SDK, the references above will be different.

After creating the assemblies and the classes, you can start working on the first class,
MyEngineDLLAccess. Details are given in the next section.

  • No labels