Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 65931 invoked from network); 16 Jan 2007 00:17:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Jan 2007 00:17:02 -0000 Received: (qmail 99251 invoked by uid 500); 16 Jan 2007 00:17:08 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 99240 invoked by uid 99); 16 Jan 2007 00:17:08 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jan 2007 16:17:08 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [212.150.49.175] (HELO mtaout5.barak.net.il) (212.150.49.175) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jan 2007 16:16:57 -0800 Received: from ILANC ([89.1.211.149]) by mtaout5.barak.net.il (Sun Java System Messaging Server 6.2-6.02 (built Apr 25 2006)) with ESMTPA id <0JBX00LM6Q3EL931@mtaout5.barak.net.il> for jdo-dev@db.apache.org; Tue, 16 Jan 2007 02:16:26 +0200 (IST) Date: Tue, 16 Jan 2007 02:16:19 +0200 From: Ilan Kirsh Subject: Thoughts about JDO 2.1 Annotation To: jdo-dev@db.apache.org, JDO Expert Group Reply-to: Ilan Kirsh Message-id: <004701c73903$95718b40$0500000a@ILANC> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-Mailer: Microsoft Outlook Express 6.00.2900.3028 Content-type: multipart/alternative; boundary="----=_NextPart_000_0042_01C73914.4EFE8260" X-Priority: 3 X-MSMail-priority: Normal X-Virus-Checked: Checked by ClamAV on apache.org ------=_NextPart_000_0042_01C73914.4EFE8260 Content-Type: text/plain; charset="windows-1255" Content-Transfer-Encoding: quoted-printable Hi all, I just added Java 5.0 annotation support to ObjectDB, following the work = that was contributed by Andy = (http://issues.apache.org/jira/browse/JDO-403). Andy did a great job, but still there might be a little room for = improvements. Following are suggestions that might be considered. 1. Using simple annotations instead of complex attributes For instance: @PrimaryKey instead of: @Field(primaryKey=3Dtrue) (or simply @Id as in JPA). And another example: @Embedded / @Embedded(false) Instead of: @Field(embedded=3D"true") / @Field(embedded=3D"false") which also solves the need to use boolean as string in order to get a = third state, which doesn't look good. This could be done at least for the more common attributes. Also, maybe @Index should be defined without unique option, by: public @interface Indexed { boolean value() default true; } or maybe even by: public @interface Unique {} and simply used with: @Indexed Do we really need so many different methods to define a unique index? 2. Discarding @Array, @Collection and @Map It seems logical to move the attributes of @Array, @Collection and @Map = to @Element, @Key and @Value. The separation (whose origin is in the = XML) is unclear to me. 3. Merging all annotations to one package Good separation seems to be very difficult. For instance - @Index, which = is currently in orm has both columns and fields as attributes. Fields = are not related to orm - just columns. If the separation remains, at = least moving @Index, @Indices, @Unique, @Uniques, @Element, @Key and = @Value that contain also non orm information should be pulled out to the = main package. 4. Type attributes should be Class rather than String For instance, in Field: Class fieldType(); instead of: String fieldType() default ""; 5. RecursionDepth Should be added somehow to the fields in @FetchGroup (and removed from = @Field if unused). Regards, Ilan Kirsh ObjectDB Software http://www.objectdb.com ------=_NextPart_000_0042_01C73914.4EFE8260--