Re: Adding enums?

From: Matt Kerr (mat..entralparksoftware.com)
Date: Fri Sep 25 2009 - 13:33:00 EDT

  • Next message: Apache Hudson Server: "Cayenne-trunk - Build # 465 - Still Failing"

    thanks for the post mike. good stuff.

    > public enum Direction/SortOrder {
    > ASCENDING, ASCENDING_INSENSITIVE, DESCENDING, DESCENDING_INSENSITIVE
    > }

    just a thought
    are these actually something like 'collation functions'
    ie
    http://en.wikipedia.org/wiki/Collation#Collation_systems
    http://www.merriam-webster.com/dictionary/collating

    maybe something like :-?
    ~~
    public Ordering(String pathSpec, Collator collator) {...}
    ~~

    On Fri, Sep 25, 2009 at 10:27 AM, Michael Gentry <mgentr..asslight.net> wrote:
    > I've started looking into this.  How about calling the sorting
    > direction enum Direction or SortOrder instead of Order?  (I can see
    > people using an ORM having an Order class already, which might be a
    > bit confusing ... sorting your Orders by an Order ...)  With the
    > change, you'd end up with a constructor something like:
    >
    > public Ordering(String sortPathSpec, Direction/SortOrder sortingDirection) {...}
    >
    > I think we should fix the case sensitive flag while we are at it.
    > Thoughts on the name for that one?  Here is the constructor ...
    >
    > public Ordering(String sortPathSpec, Direction/SortOrder
    > sortingDirection, boolean caseInsensitive) {...}
    >
    > One option is to make the Direction/SortOrder enum look something like:
    >
    > public enum Direction/SortOrder {
    >    ASCENDING, ASCENDING_INSENSITIVE, DESCENDING, DESCENDING_INSENSITIVE
    > }
    >
    > Then you don't need the third parameter.
    >
    > Thanks,
    >
    > mrg
    >



    This archive was generated by hypermail 2.0.0 : Fri Sep 25 2009 - 14:28:13 EDT