ExtendedEnumeration comments

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sun Mar 02 2008 - 12:18:27 EST

  • Next message: Michael Gentry: "Re: ExtendedEnumeration comments"

    On Mar 2, 2008, at 6:02 PM, mgentr..pache.org wrote:

    > Added:
    > cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/
    > java/org/apache/cayenne/access/types/ExtendedEnumeration.java
    > Modified:
    > cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/
    > java/org/apache/cayenne/access/QueryLogger.java
    > cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/
    > java/org/apache/cayenne/access/types/EnumType.java
    > cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/
    > java/org/apache/cayenne/access/types/EnumTypeTest.java

    Hi Michael,

    I have a few suggestions/comments/nitpicks.

    * Placing ExtendedEnumeration class in
    "org.apache.cayenne.access.types" will make it inaccessible on the ROP
    client (access.* packages are excluded from the client). So maybe put
    it under 'org.apache.cayenne'?

    * Since ExtendedEnumeration is a distinct case from just an Enum from
    the POV of ExtendedType, maybe instead of handling both via EnumType
    (and complicating the algorithm), create a separate ExtendedEnumType,
    and place the "instanceof" check in EnumTypeFactory to create an
    appropriate *Type.

    * ExtendedEnumeration is missing Apache license header.

    * From the docs: "The preferred method is to implement the Cayenne
    ExtendedEnumeration interface and provide the database value for each
    enumeration." IMO it is not universally *preferred*, it depends on the
    situation at hand and user preferences. Both methods work equally fine
    from Cayenne POV. I think we should just describe how both methods
    work and what is the difference. It seems logical to start with
    vanilla Enums and go to ExtendedEnumeration next.

    [Hmm... the more I think of it, enums mapping doesn't even belong in
    the chapter on ExtendedTypes customization anymore, as this is all
    built in Cayenne and transparent. Maybe extract it to the "Modeling
    Object Layer" chapter in the modeler guide?]

    Andrus



    This archive was generated by hypermail 2.0.0 : Sun Mar 02 2008 - 12:19:10 EST