[prev in list] [next in list] [prev in thread] [next in thread] 

List:       horde-dev
Subject:    [dev] Fwd: Re: [sync] API proposal..
From:       Chuck Hagenbuch <chuck () horde ! org>
Date:       2003-12-29 3:49:08
[Download RAW message or body]

This is of general dev interest...

----- Forwarded message from chuck@horde.org -----
    Date: Sun, 28 Dec 2003 23:40:40 -0500
    From: Chuck Hagenbuch <chuck@horde.org>
Reply-To: Chuck Hagenbuch <chuck@horde.org>
 Subject: Re: [sync] API proposal..
      To: sync@lists.horde.org

Quoting Anthony Mills <amills@gascard.net>:

> Here is a list of functions that I think should be included in lib/api.php.
>
> function list();
> function list($action, $timestamp)

PHP doesn't do overloading like this, though you could just have list($action =
null, $timestamp = null) and do the default. We also have list() methods that
take other arguments, and list() methods that return various different formats.
It's kind of a mess - some of them take sorting options, also. I'm not really
sure how to clean that up.

> function get($uid);
> function get($object);

How would you differentiate these?

How about having a general get($uid, $format = null) method, that could take
either a single id or an array of ids (for batch fetching - so that maybe we
can just have list() return uids?), and optionally a format to specify the
format to return things in.

That *should* handle pretty much any use, and might clean up list to boot.
Though, still not sure what to do about the sorting - it should be able to be
specified in the call, since this is remote access.

> function set($uid, $object);

Okay... what about also specifying the format of $object, and allowing batch
operations, too?

> function compare($object, $object, $compareflag);
> function equals($object, $object);

Do we need those for syncml, and is it really the best to have them implemented
in each app?

> function convert($object, $contentType);

Sounds useful.

> I know some of these already exist.  I am just putting them in a list
> for discussion.

Yup! We definitely have cleaning up/improvement to do here.

-chuck

--
Charles Hagenbuch, <chuck@horde.org>
"I'm really... I'm not too fascinated by green food." - Average Joe

--
sync mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: sync-unsubscribe@lists.horde.org



----- End forwarded message -----


-chuck

--
Charles Hagenbuch, <chuck@horde.org>
"I'm really... I'm not too fascinated by green food." - Average Joe

-- 
Horde developers mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: dev-unsubscribe@lists.horde.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic