Re: Re: [dev-groupware] Java OpenGroupware API - EarlyAccess Release
Helge Hess <[email protected]>
| Newsgroups | gmane.comp.cms.opengroupware.xmlrpc.devel |
|---|---|
| Message-ID | <[email protected]> |
On Friday, August 29, 2003, at 09:47 PM, murphee (Werner Schuster) wrote: > Helge Hess wrote: >> On Wednesday, August 27, 2003, at 02:51 PM, Werner Schuster wrote: >> Maybe I should be more specific why I think that one needs to be >> careful in choosing the API. The problem with the JOGI API (and the >> xmlrpcd) is that it always retrieves full OGo document objects which >> is expensive. > > Well, is there a way around that? Hm, yes two things: a) implement a server side XML-RPC method which does exactly what is required for the "foreign" API - makes most sense since it can be efficiently implemented using OGo commands b) most fetch specification support the "attributes" key which you can use to list the attributes you actually require >> So for example if you just want to display lastname, firstname and >> email address, you should only query those items from the XML-RPC >> daemon. > > er... OK, I just went through the XML-RPC documentation again, but > couldn't find any way to limit the results returned by a fetch or get; Try adding the "attributes" key with an array value listing the required attributes. > How can I tell the Xml-Rpc Daemon to return only a subset of a > document; > eg. if I call person.fetch, how can I limit the resulting documents > to, say, "Name" and "Nickname"? I think by adding "attributes = (nickname, lastname)". Not sure though, would need to try out myself ... Anyway, this has still the overhead of the OGo document API. >> This could either mean introducing something like a "PersonFragment" >> object (like there are DocumentFragments in DOM) in the JOGI API or >> just use XML-RPC directly in the "target" API since full document >> objects are not required anyway. > > hm... well, the encapsulationt hat JOGI offers should make that easy; > I mean, if you fetch() an object, you could simply fetch the Id, and if > eg. some "name" field (or whatever) is queried with eg. "getName()", > this would result in a call that fetches only the name; Which would be highly inefficient as it would result in "attribute-count x records" queries. You basically need to allow the user to fetch "fragments". Since this breaks encapsulation, it basically destroys a "neat" object model. It can be fixed by "upgrading" fragments to full objects (you might want to study object database technology if you have some sparetime ;-) Anyway. My whole point is that there is no "one-API-that-fits-all". JOGI is excellent if you need what it does. It might be wrong if you have specific needs. Eg Glow will perform a very specific kind of query so you should map it to a very specific implementation to gain good results. ZideStore has a lot of technology in that direction. It basically does a query analysation phase to determine the most effective internal OGo command for a given fetch-specification/attribute set. > Anyway, I am getting a bit offtopic for the OO.o Groupware list, > let's continue on the Xml-Rpc list at OG.o. Yup. I think Colm is subscribed there as well. Regards, Helge -- OpenGroupware.org XML-RPC [email protected] http://mail.opengroupware.org/mailman/listinfo/xmlrpc