> Brett McLaughlin [[EMAIL PROTECTED]] wrote:
> > No.... you would either do....
> >
> > TurbineServiceManager.getInstance()..... // do whatever else you want
> > OR
> > TurbineServiceManager.getInstance("somehost.com").... // do whatever
else
> > you want.
> >
> > The getInstance() to a String would return an instance or
> > XMLRpcServiceManager (or something like that) which of course you
wouldn't
> > know about as a client (casting, polymorhphism, whatever).
> >
> How about something more like this:
>  Vector params = new Vector();
>  params.addElement("someParam");
>  XmlRpcServiceManager xrsm =
TurbineServiceManager.getInstance("somehost.com");
>  Object result = xrsm.execute("doSomething", params);

Almost... I see more...

TurbineServiceManager sm =
TurbineServiceManager.getInstance("somehost.com");
Object result = sm.getService("complex_service").execute(params);

The two notable changes:
(1) The client doesn't know he is getting an XML-RPC service manager (it
would have to extend TurbineServiceManager of course...), so it is not
specific to XML-RPC or a local service manager.
(2) The execute() is called on a service returned from the service manager,
not the service manager itself.  In this case, service manager would tell
decide if the service requested was a remote or local service; if remote, it
would pass on any neccessary information when instantiating the service, and
return it to the client.  Then the client does execute on the service, which
may (or may not) do XML-RPC.  The result is returned to the client.  The
idea here is that you could easily define both local and remote
implementations of a given service, and plug them in and out with simple
properties file changes.

Make sense?

>
> or maybe:
>  Vector params = new Vector();
>  params.addElement("someParam");
>  Object result = TurbineServiceManager.getInstance("somehost.com",
> "doSomething", params);

This isn't as good, in my opinion, because it makes TurbineServiceManager do
too much... you should always have to do a getService("service_name")
because it makes it clear what is being done on the service manager.

>
> > And yes, I don't have all this on paper, so I am "walking" through it
with
> > you and inventing as I go.  I am happy to help work on it with you... I
also
> > am working on Cocoon integration, though, so my time is stretched (ain't
> > that always the case ;-) )
> >
> I thank you for your patience. :)

Ditto ;-)

-Brett

>
> --
> Christopher Elkins
>
>
> ------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Problems?:           [EMAIL PROTECTED]
>
>



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to