registration and declarations to the hub in a single atomic	operation
    Thomas Boch 
    boch at newb6.u-strasbg.fr
       
    Thu Feb 12 09:33:45 PST 2009
    
    
  
Hi Yohann,
I'll just reply from a standard point of view, and will let Mark reply 
on the JSAMP implementation details.
> I just wanted to expose my point of view concerning the way by which 
> JSAMP clients register them and declare their metadatas and 
> subscriptions.
I think JSAMP API just follows the SAMP protocol API, where 
registration, declaration of callback information, declaration of 
metadata, and declaration of supported messages are different steps.
In PLASTIC, we had a single call, and we splitted it in 4 steps on 
purpose. A client might want to update its metadata and/or the messages 
it supports according to the current list of subscribed clients, or to 
adapt to some messages he had to process, etc.
> 1) a more simple way to register a client: 1 method instead of 4 for now.
>
> something like
>    hubConnection = clientProfile.registerCallableClient(this, 
> metadatas, subscriptions);
>
> instead of
>    hubConnection = clientProfile.register();
>    hubConnection.setCallable(this);
>    hubConnection.declareMetadata(metadata);                   
> hubConnection.declareSubscriptions(subscriptions);
>
> (and if a client needs to change its metadatas or subscriptions?... 2 
> solutions:
>    - unregister, then register again (a client with new informations 
> can be considered as a new client)
I think I don't like this idea very much. First, it does not match with 
the agreed SAMP abstract API. Secondly, imagine that client A is 
interacting with client B. If client B decides for any reason to change 
its metadata, it means it unregisters and registers again, and client A 
has no way to know that the newly registered client is actually the 
former client B he was interacting with.
>    - create new "updateMetadatas(Metadatas metadatas)" and 
> "updateSubscriptions(Subcriptions subscriptions)" methods.
> )  
>
Unless I miss something, that's exactly the role of the existing 
declareMetadata and declareSubscriptions method !
Cheers,
Thomas
    
    
More information about the apps-samp
mailing list