Ok, I have some .NET code which does some allegedly useful things for some shiny new .NET code. Obviously this just calls it.
There are in fact, only about half a dozen entry points and they are also all static.
The code is in fact a replacement for some existing API's. These are currently accessed from a variety of clients. 'C'. Cobol, VB5, VB6 and also some C# and VB.Net; may be others nobody has told me about.
I need to make the new code accessible to the old clients. I see two methods, but wonder if there may be others which may be easier. I'm not too bothered about the fact the existing clients have to change, that can be done.
1. Use COM
Create a C# DLL which expose the methods on a COM visible class, the clients can then call that.
Pro: Simple for the VB5/6. Can be implemented in the Assembly with the new code. Major pain (but not impossible) for the C and Cobol clients
Con: Call overhead through Com, registering etc on deployment. But the overhead isn't really an issue since they are functional rather than chatty
2. Use C++
Create a mixed C++/CLR DLL; decorate the methods to expose a flat API.
Pro: Basically the same interface as currently exists, save it is different DLL
Con: Forces a bridge to be inserted between the application and the new code providing service.
---------
Any other methods I should consider (I can move forward to any version of Visual Studio and the framework if needed).
In an ideal world I would just like to decorate the static methods with a mythical [MakeThisAvailableAsAFlatAPI] attribute.
I don't envisage any problems with parameters since they are all primitive data types and one block of data so should be able to marshal these without difficulty.
There are in fact, only about half a dozen entry points and they are also all static.
The code is in fact a replacement for some existing API's. These are currently accessed from a variety of clients. 'C'. Cobol, VB5, VB6 and also some C# and VB.Net; may be others nobody has told me about.
I need to make the new code accessible to the old clients. I see two methods, but wonder if there may be others which may be easier. I'm not too bothered about the fact the existing clients have to change, that can be done.
1. Use COM
Create a C# DLL which expose the methods on a COM visible class, the clients can then call that.
Pro: Simple for the VB5/6. Can be implemented in the Assembly with the new code. Major pain (but not impossible) for the C and Cobol clients
Con: Call overhead through Com, registering etc on deployment. But the overhead isn't really an issue since they are functional rather than chatty
2. Use C++
Create a mixed C++/CLR DLL; decorate the methods to expose a flat API.
Pro: Basically the same interface as currently exists, save it is different DLL
Con: Forces a bridge to be inserted between the application and the new code providing service.
---------
Any other methods I should consider (I can move forward to any version of Visual Studio and the framework if needed).
In an ideal world I would just like to decorate the static methods with a mythical [MakeThisAvailableAsAFlatAPI] attribute.
I don't envisage any problems with parameters since they are all primitive data types and one block of data so should be able to marshal these without difficulty.
Comment