cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aristedes Maniatis <...@ish.com.au>
Subject Re: CayenneObjectManager - alternative API for using Apache Cayenne
Date Sun, 24 Feb 2008 10:57:20 GMT

On 24/02/2008, at 9:13 PM, David Marko wrote:

> // find first item by property and given condition
> co_manager
> .find(Class).byProperty("property").BETWEEN(value1,value2).first()
> co_manager.find(Class).byProperty("property").LIKE(value).first()
> co_manager.find(Class).byProperty("property").IN(range).first()

This looks a lot like the Fluent interface [1] Andrus has proposed as  
a possible way to generify the query API. Have a read of the relevant  
thread [2] for further info there. It is an interesting idea but quite  
hard to write documentation for (such as javadocs) and possibly hard  
for newcomers. On the other hand it is very compact and readable.


Ari Maniatis



[1] http://martinfowler.com/bliki/FluentInterface.html
[2] http://markmail.org/message/jqfjtsogixpeijsn


-------------------------->
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001   fax +61 2 9550 4001
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A



Mime
View raw message