db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: Annotation enum : IdGeneratorStrategy
Date Thu, 09 Aug 2007 17:59:27 GMT
The only advantages I see to using an enum is in constructing the  
annotation using auto-completion tools and verification during  
compile time. So I could go either way.

A mistyped strategy would result in an error during enhancement or  
deployment so it's not silent, just delayed.

Anyone else have an opinion?

Craig

On Aug 9, 2007, at 9:54 AM, Matthew T. Adams wrote:

> +1
>
> -----Original Message-----
> From: Andy Jefferson [mailto:andy@jpox.org]
> Sent: Thursday, August 09, 2007 9:47 AM
> To: jdo-dev@db.apache.org; JDO Expert Group
> Subject: Annotation enum : IdGeneratorStrategy
>
> JDO2 defines particular id generation
> strategies ... "identity", "increment", "sequence", "uuid-string",  
> "uuid-hex", "native".
> Obviously implementations can define their own add-on strategies.
>
> In XML we have free-form text and so people can just type
> <field value-strategy="auid"> and rely on the implementation  
> providing one
> called "auid".
> In Annotations they currently can't do this since it uses an enum.
>
>
> Two possible options
> 1. Remove IdGeneratorStrategy enum and just let people type in
> the "valueStrategy" name (and @DatastoreIdentity "strategy"), so  
> they can
> access implementations own variants too.
> 2. Make implementations use the @Extension to access these vendor  
> add-on
> strategies and use IdGeneratorStrategy.UNKNOWN (which is in the enum
> currently)
>
>
> I'm swaying towards 1 since its more consistent with XML  
> specification. Any
> opinions ?
>
> -- 
> Andy  (Java Persistent Objects - http://www.jpox.org)
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message