That's exactly right. I've created a factory that uses reflection to find non-public constructors from which objects are created. This works great.
It sounds like I will have to keep the factory. Using the factor is good...Once I discovered how remoting works, I began to see other possibilities creating new objects. No factory would be necessary which would make creating objects easier and more natural. Thanks Chris ----- Original Message ----- From: "Marsh, Drew" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 07, 2002 3:01 PM Subject: Re: [DOTNET] .Net Remoting and CreateInstance > Chris Rolon [mailto:[EMAIL PROTECTED]] wrote: > > > MyObject obj = factory.CreateObject(typeof(MyObject)); > > > > is less natural and less intuitive than > > > > MyObject obj = new MyObject(). > > > > > > I have fooled around with the ProxyAttribute and > > ContextBoundObject and have successfully created my object. I > > just don't like having to inherit from ContextBoundObject and > > hoped that there was a better way for non-remotable objects. > > You're right, it is less natural and intuitive, but if you also don't want > to pay the overhead of the ContextBoundObject rules then I believe that's > your only choice. I assume you're not going to expose any public > constructors then and instead just have internal or private constructors > which the factory can call via reflection? > > Later, > Drew > .NET MVP > > You can read messages from the DOTNET archive, unsubscribe from DOTNET, or > subscribe to other DevelopMentor lists at http://discuss.develop.com. > You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.