OTOH - it makes sense to be able to serialize out a Criteria and send it over the wire as a value object -- probably it will be custom marshal/unmarshal code and sending the whole Criteria rather than invoking remote methods on one (triple-ick).

For simplicity's sake I would probably build my own criteria that serialized to ODMG OQL (I'd probably start with the JDBC Crtieria library I did ( http://kasparov.skife.org/sqlbuilder.html ) and modify it to build OQL instead of SQL, but that would be a minor change. Then I'd expose this.

Implenting nice Criteria serialization/deserialization sounds like a Good Idea to me, particularly if we can nicely encapsulate the SPI and API per Thomas's suggestion for 1.1.

-Brian

On Dec 11, 2003, at 1:04 PM, Brian McCallister wrote:

Hmm, I would think that exposing a Criteria to as a WebService is a bit too fine grained.

A better solution, to me, is to expose something that takes a query language type query and gives you back a result, for instance:


/**
* @whatever-the-tag-is-to-tell-xdoclet-to-generate-stub-and-wsdl-for- axis
*/
public Object[] query(String query)
{
DList results QueryService.execute(query);
return results.toArray();
}


Encapsulating a whole query in one request (invocation) cuts down drastically on the chatter of lots of calls to a remote Criteria, and allows you to make the web service stateless (much preferred).

Criteria just seem far too fine-grained and API specific to be good web service candidates =/

This doesn't really answer your question, I know, but I think the answer is that using Criteria as a remote object via a web service isn't a hot idea.

-Brian

On Dec 11, 2003, at 12:35 PM, Gary wrote:

I'd like to expose the Criteria class via a web
service, so clients can easily create rich queries.
However, the class uses a number of other classes
(different types of Collections, for example) that
don't "flatten out" well into SOAP.

Has anyone tackled this before?  Any code or ideas out
there?

Thanks, Gary

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to