ant elder wrote:
On Wed, May 13, 2009 at 1:05 PM, Simon Laws <[email protected]> wrote:
I had a chat with Mike about what to do to improve this and we have a
way that will help for now while we don't have a more comprehensive
approach that works when we've support for distributed domains and
clients remote from the nodes. I'll commit a strawman and post back
here with details when thats in.

  ...ant

Just looking at ...

public class SCAClientImpl implements SCAClient {

  ....

   public static void addDomain(URI domainName, Node node) {
       nodes.put(domainName, node);
   }

   public static Node removeDomain(URI domainName) {
       return nodes.remove(domainName);
   }

Why wouldn't we create a client for a specified domain. What is the
scenario where we would want to add more than one?

Simon


Actually i agree that seems more natural but thats not the approach
being taken by the current SCAClient API. The API is:

   SCAClient scaClient = SCAClientFactory.newInstance();

so there is no domain name in there and the returned SCAClient is
generic for any/all domains.

Then you tell it which domain you want to talk to in the getService call:

   scaClient.getService(type, serviceName, domainURI)

What i think you're asking and what i thought seemed more natural
would be to have:

   SCAClient scaClient = SCAClientFactory.newInstance(domainURI);
   scaClient.getService(type, serviceName);

I guess its a different way of thinking about what an SCAClient is,
maybe if any of the spec folks are listening they could explain more?

   ...ant


The SCAClient is vendor implementation specific.  This is because it
needs to deal with domains, and domains are vendor implementation
specific.

Imagine the situation where vendor A's implementation is used for
domains A1 and A2, and vendor B's implementation is used for domains
B1 and B2.  It would not be possible to have a single SCAClient
or SCAClientFactory that understands all four of these domains.
Therefore the spec API proposal (it's not agreed yet, and there is
some discussion on whether we have the right defaulting mechanism)
requires vendor A to provide an SCAClientFactory implementation that
returns an SCAClient capable of locating domains A1 and A2 using
some proprietary mechanism.  Vendor B also needs to provide an
SCAClientFactory implementation that returns an SCAClient capable of
locating domains B1 and B2 using some other proprietary mechanism.

The SCAClientFactory.newInstance() call uses various mechanisms
to identify which vendor-specific SCAClient implementation to
return.  The returned SCAClient object will be capable of locating
all domains that use the same vendor implementation that created
the SCAClient object.

The alternative form suggested above doesn't work because it would
require the SCAClientFactory to maintain some global knowledge of
which domains use which vendor implementations, and return the
appropriate SCAClient vendor implementation for the domain specified.

  Simon


Reply via email to