[dev] Fwd: Re: [sync] API proposal..
Chuck Hagenbuch
chuck at horde.org
Sun Dec 28 20:43:59 PST 2003
This is of general dev interest...
----- Forwarded message from chuck at horde.org -----
Date: Sun, 28 Dec 2003 23:40:40 -0500
From: Chuck Hagenbuch <chuck at horde.org>
Reply-To: Chuck Hagenbuch <chuck at horde.org>
Subject: Re: [sync] API proposal..
To: sync at lists.horde.org
Quoting Anthony Mills <amills at 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 at 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 at lists.horde.org
----- End forwarded message -----
-chuck
--
Charles Hagenbuch, <chuck at horde.org>
"I'm really... I'm not too fascinated by green food." - Average Joe
More information about the dev
mailing list