Anonymous user

Talk:Proposed Yadis API

From Yadis

Jump to: navigation, search

Would it be better to have a parameter for the service, instead of a method for each service?


Other proposal

Why tie the interface to OpenID and LID only? Why not something like this:

boolean ServiceSupported(String TypeURI);
void UseService(String TypeURI);
boolean HasFirstServiceURL; 
boolean HasNextServiceURL;
String GetFirstServiceURL; // automatically uses highest priority or random if multiple URLs present
String GetNextServiceURL; // ordered by priority, this functionality is encapsulated
String GetCustomField(String FieldURI);

This is an example (pseudocode) how to use it:

 if (Yadis.ServiceSupported("")) {
  URL = Yadis.GetFirstServiceURL;
  while (!HTTP.Get(URL) && Yadis.HasNextServiceURL) { URL = Yadis.GetNextServiceURL; }
  // do OpenID stuff, e.g. use GetCustomField("openid:delegate");
 } else
 if (Yadis.ServiceSupported("") {
  // do stuff
 } else
 if (Yadis.ServiceSupported("") {
  // do stuff
 } else Error;

--Http:// 06:01, 11 March 2006 (PST)

When working on my Yadis library in Delphi I didn't exactly followed my own proposal myself but did it differently, seperating the task into two classes, one for XRDS files that extends an XML file object (makes it easy to analyze complex structures, e.g. namespaces for services) and one that does the discovery job: I'm still working on it and haven't implemented the priority concept.

--Http:// 06:53, 22 April 2006 (PDT)

Personal tools