Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Java OpenGroupware API - annotations: msg#00015

cms.opengroupware.xmlrpc.devel

Subject: Re: Java OpenGroupware API - annotations

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
in almost the same way like implementing iterators but the benefits
of list will be obtained.

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
whats about the open connections?
there are to ways of doing the fetch

a) create a connection to server, process the query and leave the connection open for reading the elements

b) save the query and execute it only if the first element needed...
but the connection is open too (a little later but open)....

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>
Google Custom Search

Recently Viewed:
solaris.opensol...    editors.vim/200...    web.turbogears....    jakarta.ant.dev...    mathematics.max...    text.unicode.ge...    lang.ruby.core/...    xfce.announce/2...    network.centeri...    php.cvs.pear/20...    user-groups.lin...    kde.devel.quant...    file-systems.ar...    redhat.fedora.t...    apple.fink.auto...    gnome.orbit.gen...    qplus.devel/200...    culture.transpo...    video.dri.user/...    operators.nanog...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive 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

Navigation