Re: CayenneObjectManager - alternative API for using Apache Cayenne

From: Aristedes Maniatis (ar..sh.com.au)
Date: Sun Feb 24 2008 - 05:57:20 EST

  • Next message: David Marko: "Re: CayenneObjectManager - alternative API for using Apache Cayenne"

    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



    This archive was generated by hypermail 2.0.0 : Sun Feb 24 2008 - 05:58:07 EST