|
|
Choosing A Webhost: |
Re: Java OpenGroupware API - annotations: msg#00015cms.opengroupware.xmlrpc.devel
Burkhard, please don't embed the whole message you are replying to ... That s***s big time. First: please consider my points as suggestions. The JOGI team should define the JOGI API ;-) Just wanting to point out problems we already did wrong in the past - the issues are practical experiences. On Montag, Sep 1, 2003, at 17:02 Europe/Berlin, Burkhard Sell wrote: i know the problem with counting iterators... No this is no problem as I lined out in my other posting. If the API supports the availability of the count, a custom enumerator subclass can provide it. Thats basic OOP ... And again: I'm not against having a List API in *addition* for convenience! Its just that XML-RPC (and most other protocols ...) are streamed. And the enumerator is just that - an object stream - so we have the ideal 1:1 match. an own implementation of the List interface should fix the problem Well, using the "wrong" API (one that doesn't match the characteristics of the backend) results in a lot of such artificial workarounds. In practice this is seldom worth the effort. This is also why almost all object-relational mapping tools are actually less usable than direct JDBC ... They try to do too much which finally results in a loss. (usually they don't work with a bit larger datasets which more or less destroys the whole idea in having a database backend ;-) but the countingproblem still exists. There is no such problem. Either you have the count available prior reading all objects - in that case you can subclass enumerator - or you dont - in that case you need to read everything anyway. you can't count elements before reading the whole stream. Of course. Which is why list is the wrong API for the task at hand ;-) Layer: /-------------------\ | XML-RPC API | - integration layer |--------\/---------| | Streamed Objects | - for feeding export tools |--------\/---------| | Collected Objects | - for feeding table views \-------------------/ the API offers two methods for each kind of fetching. In Objective-C we have it that way: interface EODataSource public void setFetchSpecification(EOFetchSpecification fspec); public EOFetchSpecification getFetchSpecification(void); public Enumerator fetchEnumerator(); public List fetch(); end *Unfortunately* the latter was the first in OGo which leads to exactly the problems I have brought up. Do not make the same mistake and base the fetch() method on the fetchEnumerator. @helge Well, this is an implementation detail. I think in the case of XML-RPC you may actually want to have a multithreaded implementation in Java which goes like: // this starts an async fetch in the second channel Enumerator e = dataSource.fetchEnumerator(); // no we block if some record is still missing or continue // if the producer received a XML-RPC record while ((person = e.nextObject()) print("Name: " + person.getName()); I would do the XML-RPC => object conversion in the main thread. whats about timeouts??? Good point. Timeouts can destroy/invalidate the local object graph (so you would actually need a transaction mechanism like the EOEditingContext in EOF). The API should always use functions for retrieving relationships - never ivars (only for caching purposes). That way the object graph is not "fixed" after a fetch but can be completed in an incremental way. Timeouts should be set on the connection object. regards, Helge -- OpenGroupware.org - http://www.opengroupware.org -- OpenGroupware.org XML-RPC xmlrpc@xxxxxxxxxxxxxxxxx http://mail.opengroupware.org/mailman/listinfo/xmlrpc
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Some more XML-RPC questions, Martin Hoerning |
|---|---|
| Next by Date: | Re: Java OpenGroupware API - annotations, Helge Hess |
| Previous by Thread: | Re: Java OpenGroupware API - annotations, Burkhard Sell |
| Next by Thread: | Re: Java OpenGroupware API - annotations, Andreas Rath |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |