
August 24th, 2005, 06:18 PM
|
|
Registered User
|
|
Join Date: Aug 2005
Location: Harrisburg, PA
Posts: 1
Time spent in forums: 33 m 29 sec
Reputation Power: 0
|
|
|
Remoting/service types & friend classes
Hello all. This is my first post and I'm afraid it's a doozie. Bear with me.
I'm writing an ASP.NET web app that needs to access a Service object via Remoting. I must use a service for the ability to run under a different username, since the ASPNET user and impersonation are forbidden.
The service object I'm accessing, BaseObject, contains six classes based on functionality -- BatchProcessing.vb, Reports.vb, etc. Initially when I set up the service's OnStart() event, I registered each class as its own Remoting service type. This seemed risky, having multiple types of objects hosted as their own Remoting service on the same TCP port. It also seemed cumbersome, having to track all the different service names.
So instead I added a wrapper class (for lack of a better phrase) to BaseObject and called it BaseEntry. BaseEntry exposes all the methods needed by the web app and works as a pass-through to the six friend classes. The problem with this approach is, any changes to method signatures now have to be made in two places: the original class and then BaseEntry.
I guess what I'm wondering is if my second approach is the only (or most graceful) way of having a single Remoting service object while still having access to that object's friend classes.
I appreciate any input/suggestions.
|