Contributor - dNIMS (dotNET Interaction Mechanism for Scilab)
Project Description
SEP: SEP-dotNET Interaction Mechanism for Scilab + Environment Abstraction Layer.odt
The goal is this project is allow a Scilab user to access .NET objects and interact with them. Another task is to create an abstract layer for interaction with any object-oriented environment. There is also a great module JIMS for such interation with Java environment. It will be used as a basis for abstraction. Then, classes, providing .NET interaction tools will implement the abstract interface. To interact with other envirnoments, developer will need just implement proper abstract classes and do minimal updates to other code.
Abstract classes for object-oriented environment interaction
Following classes will represent tools for interaction with environment:
Following steps need to be performed for abstraction from Java in JIMS:
- add abstract environment classes
modify JIMS classes ScilabJavaObject, ScilabJavaClass, etc. to implement abstract interface
- add abstract factory to get classes for interaction with environment by environment identifier
- rename gateway functions to abstract names
- identify environment in gateway functions
- use abstract factory and perform polymorphic calls in ScilabObjectsCPP.cpp
Interaction with .NET
Unfortunately, there is no cross-platform way to call .NET/Mono from native C++. Thus, different implementations must be provded for Windows and Unix platforms.
Windows
On Windows platform flat API (Win32) mechanism will be used: Interop: A Look at Managed C++
A managed C++ layer between Scilab (ScilabDonNetEnvironment class) and .NET will perform operations on objects management, libraries load and methods invocations (pretty much like Java part in JIMS). Methods of this layer will be exposed as row dll exports and will be used from Scilab C++ part.
Unix
Mono embedding abilities will be used to interact with Mono from Scilab. This will aslo include 2 layers (second will be just like one for Windows, but without COM stuff)
- implementation of abstract classes C++ - classes, which will use Mono embedding tools to Mono .NET util
- Mono utility, which will receive requests from previous level and retrieve .NET-assemblies information or pass calls using Reflection.
Main features of dNIMS will be:
- Create instances of .NET classes.
- Interact with .NET objects via their class members.
- Compile .NET code and create assemblies
For example, in the Scilab language, this could make
-->asm = dotnetload('System.Windows.Forms'); -->dotnetimport('System.Windows.Forms.*'); -->MessageBox.Show('Simple Message Box')
Roadmap
Tasks |
Description |
Status |
Create abstract classes and abstract factory for environment interaction |
|
Done |
Abstract from Java classes in JIMS |
Implement abstract classes, use abstract factory, add enum for environment, identify environment in gateways |
Done |
Create managed C++ layer for handling .NET classes and objects |
|
Done |
Implement abstract classes for .NET interaction (ScilabDonNetEnvironment) |
|
Done |
Test dNIMS and JIMS functionality |
|
In progress |
Write dNIMS help and demos, help for creating connectors to other object-oriented environments |
|
In progress |
Links
http://forge.scilab.org/index.php/p/jims/ - The Java equivalent (already implemented)