COM+ using Component Designer?

R

Raffe

Hi all!

I've been playing a bit with Component Designer in Visual Studio.NET. Seems
to me like a great way to build simple data access components using "point
and click". However I can't figure out how to make a component made this way
into a component with transactional support which can be put into COM+.

The class which is Component Designer ends up with inhertits from
System.ComponentMode.Component. I understand that a class which will run
under COM+ has to inherit from ServicedComponent. Well, it can't inherit
from both. And I'd like to avoid mass coding of wrappers and things like
that.

Could someone point me a way to a simplest way to make a
ComponentModel.Component into an ServicedComponent?

Thanks in advance

Rafael
 
T

Tomas Restrepo \(MVP\)

Raffe,
I've been playing a bit with Component Designer in Visual Studio.NET. Seems
to me like a great way to build simple data access components using "point
and click". However I can't figure out how to make a component made this way
into a component with transactional support which can be put into COM+.

The class which is Component Designer ends up with inhertits from
System.ComponentMode.Component. I understand that a class which will run
under COM+ has to inherit from ServicedComponent. Well, it can't inherit
from both. And I'd like to avoid mass coding of wrappers and things like
that.

Could someone point me a way to a simplest way to make a
ComponentModel.Component into an ServicedComponent?

The short of it is: you can't.

One thing to note is that what the VS.NET IDE and the framewor call
"components" usually refer to classes deriving from
System.ComponentModel.Component, which are basically classes that support
the IDE designer facilities. ServicedComponents, on the other hand, have
nothing at all to do with this.

One great conflict thus arises: both kinds require you to inherit from a
base class (either Component, or ServicedComponent), which are not related.
So it means that at this point, you need to choose between them and can't
combine them.

If you'd like to keep using the designer facilities, I'd suggest creating
your component as you are now, and then wrapping it into a
ServicedComponent-derived class.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top