C# class and COM+ issue
-
Hi, I've subclassed two classes inside classA. Theses subclasses are derived from classA. There are some virtual functions in classA with their implementation defined in those subclasses. Client can only see classA. Instances of classA will be created by a class factory. On basis of parameters passed to class factory, the factory creates new objects of subclasses and returns them to client. Following snippet demonstrates the idea.
public class classA { /* some non-virtual functions with implementation defined */ /* some virtual functions with implementation defined in subclasses */ internal class subclass1 : classA { /* implementation of virtual functions declared in class A */ } internal class subclass2 : classA { /* implementation of virtual functions declared in class A */ } }
1) I want to run subclass1 objects into COM+ transaction. Is it possible because client never sees subclass1 although it uses subclass1. If possible how ?? 2) Is it a good practice to do things this way. The idea behind was to provide client smplicity of using one class while acheiving the logical seperation at the backend for developer's ease. Thanks in advance, Regards, Hatim Ali.