Re: Adding enums?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Sep 25 2009 - 12:08:25 EDT

  • Next message: Matt Kerr: "Re: Adding enums?"

    On Sep 25, 2009, at 5:27 PM, Michael Gentry 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 guess any of the above can potentially be an entity name, but I am
    fine with either of the 3.

    > 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.
    >

    Good idea.

    Andrus



    This archive was generated by hypermail 2.0.0 : Fri Sep 25 2009 - 13:17:04 EDT