views:

65

answers:

1

Hello there,

my job is to access a CPRBA-server-application from .NET 3.5. After evaluating projets like IIOP.Net (undefined state) and products like VisiBroker (expensive) I'd like to do it "by myself" and write a .Net-Wrapper around C++-Stubs generated my Omniidl (the Omniorb IDL to C++ generator). This means writing some kind of layer of managed code (CLI) around the unmanaged C++ code.

My question is: Has anyone experience in this topic? I honestly don't know how to do it the best way. Right now I plan to create a managed class for every unmanaged class, each managed class itself has a member to an instance of the unmanaged class, which is not garbage-collected. Is this the right way to do it or am I on the wrong path?

Thanks in advance!

A: 

From my experience this is one way to solve this problem - for every unmanaged class write a wrapper .NET class. You should look into using code generation so that you wouldn't need to write a lot of code.

Another option is to create .NET wrappers around common functionality - you could reduce some of the work by using a facade - if you have several classes that you need for a single operation or a group of operations you can create a single .NET class that manages all of them.

Dror Helper
Thank you for your answer!I also think "wrapping everything" would be too much effort spent, writing some kind of facade and therefore wrapping only the needed methods and structs sounds more reasonable.Code-generation sounds interesing, too: Would you happen to know any recommendable code-generators who would do the job? :)
Superfisi
You can use Code smith (http://www.codesmithtools.com/) for your code generation needs
Dror Helper