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?

--Joaquin
[edit]

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("http://openid.net/signon/1.0")) {
  Yadis.UseService("http://openid.net/signon/1.0");
  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("http://lid.netmesh.org/sso/2.05b") {
  // do stuff
 } else
 if (Yadis.ServiceSupported("urn:a.brand.new.signon.service") {
  // do stuff
 } else Error;


--Http://mylid.net/lukasros 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: ftp://ftp.lukasrosenstock.net/lrdd/code/leaSystem/source/leaXRDSProcessor.pas I'm still working on it and haven't implemented the priority concept.

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

Personal tools