Re: Extended Enumerations

From: Michael Gentry (blacknex..mail.com)
Date: Thu Feb 28 2008 - 09:37:33 EST

  • Next message: Rares Ispas (JIRA): "[jira] Created: (CAY-992) Modeler does not escape entity names"

    The original enum code by Andrus only accounted for strings/ints, too.
     If there is a compelling argument later to support additional basic
    types, I think that can be handled. I was talking with a co-worker
    and he suggested dates. The more we talked about it, though, the less
    it made sense. For example, if you had a Holidays enum, the Java date
    also contains the year. That makes it less useful, plus you have
    holidays (Easter) that shift around ever year. It just didn't seem
    reasonable to make a sort-of constant out of something like that. I'm
    not claiming I've thought of every possible usage, but supporting
    string/int seems a good start.

    Thanks,

    /dev/mrg

    On Thu, Feb 28, 2008 at 5:45 AM, Aristedes Maniatis <ar..sh.com.au> wrote:
    > Great. That's good for me too, since whatever you add will be easy
    > enough for me to incorporate in our work and I'll give you my +1 now
    > for adding it to Cayenne :-)
    >
    > Please pinch anything from it you find useful. Without thinking about
    > it deeply though, it does seem possible that this API could be
    > generified to be more useful, although in 99% of cases a user will
    > want integer database values and string user interface values.
    >
    > Ari
    >
    >
    >
    >
    >
    >
    > On 28/02/2008, at 3:01 AM, Michael Gentry wrote:
    >
    > > Ari, I took a glance at the code you sent me and on first look, it
    > > appears to be similar to what I did for my Cayenne 1.2/2.0 enum
    > > support (using Java 1.4 only, though) and the current stuff I'm
    > > adding. I'll get to work on it again in the next few days, but wanted
    > > to give you a little feedback.
    > >
    > > Thanks,
    > >
    > > /dev/mrg
    > >
    > >
    > > On Mon, Feb 25, 2008 at 5:44 PM, Aristedes Maniatis <ar..sh.com.au>
    > > wrote:
    > >>
    > >> On 26/02/2008, at 1:43 AM, Michael Gentry wrote:
    > >>
    > >>> I did some work on extended enumerations (where the DB value can be
    > >>> defined) this weekend
    > >>
    > >> Interesting. If this list passes through my attachments, I've
    > >> included
    > >> some classes from our ROP project which might help give you another
    > >> example of how this might be used. They are ExtendedTypeIntegerEnum
    > >> which is an interface implemented by IntegerEnumType (server side
    > >> only) and ClassCostType (an example enumeration which is available to
    > >> both client and server).
    > >>
    > >>
    > >>
    > >>
    > >>
    > >>
    > >> The naming and docs could be better but it works pretty well. Despite
    > >> the copyright headers, you have permission to use any bits of this
    > >> you
    > >> find useful. As you can see, the approach is quite similar: a
    > >> persistent value and a display value (for popup menus for instance)
    > >> declared in the constructor.
    > >>
    > >>
    > >> Ari
    > >>
    > >>
    > >>
    > >>
    > >> -------------------------->
    > >> 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
    > >>
    > >>
    > >>
    > >>
    >
    >
    >
    >
    >
    > -------------------------->
    > 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 : Thu Feb 28 2008 - 09:38:27 EST