Moby Central API (was Re: [MOBY-l] service = method ?)

Martin Senger senger at ebi.ac.uk
Fri Oct 25 07:53:29 UTC 2002


[ I have splitted my answer to two topics - perhaps easier to trace it 
later in the mailing list archive.]

>
> Clearly, SOAP will support other languages also; although MOBY Central 
> does not have a WSDL, the API is (I believe) sufficiently well described 
> both online and in the POD documentation that clients in other languages 
> should not be particularly difficult to write.
>
   Actually, it turned out that it was difficult. I was trying a client in
Java but was not able to write it without looking in the Moby Central code
(but I admit that after reading the code, it was quite easu to write my
client). But Mark already suggested (see below about the new() method) how
to solve the problems I had.
   Regarding the WSDL of Moby Central, it will be easy to add it, once the 
issue with the new() method is solved (again see below). I will be happy 
to create a WSDL and send it here. 

> I do agree with one comment you made to me offline that the current MOBY 
> Central API has an unnecessary "new" function.  There is really no 
> reason for MOBY Central to be OO, since the MOBY Central object 
> currently does not hold any useful information... it just looked 
> prettier, and I assumed that it would be ~equally easy to implement in 
> all languages.  If this is not the case, I can change the interface.
> 
   The problem with the new() method is not that it exists but that the
returned data type (a Moby Central object) is not well defined in the
documented API. The Perl code says it, however, clearly - the returned
object is a hashtable (as usual for Perl objects), and as such it is easy
to use it in (for example) Java clients.
   The knowledge of the data type returned by the new() method is needed 
for any other method call because their first parameter is always the Moby 
Central object (am I right here, Mark?).
   So it seems to me that the existence of the new() method is not only 
that it "looks prettier", but that it allows to keep a session state. In 
other words, the new() method returns a "handler" which is later used by 
the same user - so the handler can (if the implementation needs and wants 
it) recognize that the same user is coming back.
   Was this behaviour wanted or was it just "a lucky side-effect"?
   Summary:
   1) If the "session behaviour" is wanted, there is no need to change the
interface - and I can send a WSDL of Moby Central at once, The only change
would go to API documentation saying that the returned data type of the
new() method is a hashtable.
   2) Else, let's change the API so that:
      - the new() method is removed, and
      - the first parameter of all other methods is removed.
      Then again I can create and send it a WSDL.

   Regards,
   Martin

-- 
Martin Senger

EMBL Outstation - Hinxton                Senger at EBI.ac.uk     
European Bioinformatics Institute        Phone: (+44) 1223 494636      
Wellcome Trust Genome Campus             (Switchboard:     494444)
Hinxton                                  Fax  : (+44) 1223 494468
Cambridge CB10 1SD
United Kingdom                           http://industry.ebi.ac.uk/~senger




More information about the moby-l mailing list