You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Gary <gl...@yahoo.com> on 2003/12/11 18:35:45 UTC
Web Services Friendly Criteria Classes
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: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Web Services Friendly Criteria Classes
Posted by Brian McCallister <mc...@forthillcompany.com>.
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: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Web Services Friendly Criteria Classes
Posted by Brian McCallister <mc...@forthillcompany.com>.
Mid ether collision =)
-Brian
On Dec 11, 2003, at 1:11 PM, Gary wrote:
> Thanks for the post.
>
> I meant exposing Criteria as a transfer object, so the
> client could instantiate one and fill it in as
> necessary. Not exposing its methods as web services.
>
> I agree that it may be too fine grained - hence my
> query as to whether anyone else has created a "skinny"
> Criteria class (or some such thing).
>
> Gary
>
>
> --- Brian McCallister
> <mc...@forthillcompany.com> 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:
>> ojb-user-unsubscribe@db.apache.org
>>> For additional commands, e-mail:
>> ojb-user-help@db.apache.org
>>>
>>>
>>
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail:
>> ojb-user-help@db.apache.org
>>
>
>
> __________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Web Services Friendly Criteria Classes
Posted by Martin Kalén <ma...@curalia.se>.
Hello,
Gary wrote:
> I agree that it may be too fine grained - hence my
> query as to whether anyone else has created a "skinny"
> Criteria class (or some such thing).
We have a back-end driven by OJB that is "web service enabled" (buzzword
compliant :) through Apache WS Axis. This back-end has it's own
Criteria-class/query-builder interfaces exposed in the WSDL. The
back-end then builds an SQL criteria from the serialized critera and
uses OJB QueryBySQL-class to convert it into an OJB-compatible criteria.
The bySQL-method might not be what you want, but a similar approach
could be used for any "skinny" critera classes you create - just unwrap
field names and conditions on the server side and assemble corresponding
OJB-criterias from those. This way you would not have to expose any
OJB-classes in your WSDL.
Regards,
Martin
--
Martin Kalén
Curalia AB Web: http://www.curalia.se
Orrspelsvägen 2B Mail: info@curalia.se
SE-182 79 Stocksund Tel: +46-8-410 064 40
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Web Services Friendly Criteria Classes
Posted by Gary <gl...@yahoo.com>.
Thanks for the post.
I meant exposing Criteria as a transfer object, so the
client could instantiate one and fill it in as
necessary. Not exposing its methods as web services.
I agree that it may be too fine grained - hence my
query as to whether anyone else has created a "skinny"
Criteria class (or some such thing).
Gary
--- Brian McCallister
<mc...@forthillcompany.com> 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:
> ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail:
> ojb-user-help@db.apache.org
> >
> >
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail:
> ojb-user-help@db.apache.org
>
__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Web Services Friendly Criteria Classes
Posted by Brian McCallister <mc...@forthillcompany.com>.
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: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org