Re: [sca-j] JAVA-139: Discussion

From
Mike Edwards <>
Date
2009-06-15T20:41:37+00:00
ID
Thread
Re: [sca-j] JAVA-139: Discussion
Folks,

Sorry to be on the brutal side, but
why would we want to do this?

It looks and feels complex - and the
use case looks paper thin to me.

My reaction to 139 is to say "close
with no action"

Yours,  Mike.

Strategist - Emerging Technologies, SCA & SDO.

Co Chair OASIS SCA Assembly TC.

IBM Hursley Park, Mail Point 146, Winchester, SO21 2JN, Great Britain.

Phone & FAX: +44-1962-818014    Mobile: +44-7802-467431  

Email:  

From:
Simon Nash <>

To:
OASIS Java <>

Date:
15/06/2009 15:24

Subject:
[sca-j] JAVA-139: Discussion

I haven't had any reply from Vamsi to the email I
sent him about this.

The main problem I see is what type to use for the new defaultValue

attribute on the @Property annotation.  @Property can to applied to

any Java type, which means that the default value can also be of any

Java type.

It's not possible to use a type of java.lang.Object for an attribute

of an annotation.  One possible approach would be to define separate

defaultValueXXX attributes for each Java primitive type and String.

With this approach, the user would have to write code like:

   @Property defaultValueInt(10)

   protected int discountRate;

We would also need defaultValueXXX attributes for arrays of these types.

This takes care of simple-valued properties, but it doesn't provide

any way to provide a default for a complex-valued property that is

represented in Java by a class using JAXB mappings.

For the complex-valued property case (including enums), it would be

possible to use an XML string to represent the default value.  We

could support this by defining a defaultValueXML attribute.

With this approach we would need the following new attributes:

   boolean defaultValueBoolean() default false;

   byte defaultValueByte() default 0;

   char defaultValueChar() default ' ';

   double defaultValueDouble() default 0.0d;

   float defaultValueFloat() default 0.0f;

   int defaultValueInt() default 0;

   long defaultValueLong() default 0;

   short defaultValueShort() default 0;

   String defaultValueString() default "";

   boolean[] defaultValueBooleanArray() default {};

   byte[] defaultValueByteArray() default {};

   char[] defaultValueCharArray() default {};

   double[] defaultValueDoubleArray() default {};

   float[] defaultValueFloatArray() default {};

   int[] defaultValueIntArray() default {};

   long[] defaultValueLongArray() default {};

   short[] defaultValueShortArray() default {};

   String[] defaultValueStringArray() default {};

   String defaultValueXML() default "";

Comments, suggestions?

   Simon

---------------------------------------------------------------------

To unsubscribe from this mail list, you must leave the OASIS TC that

generates this mail.  Follow this link to all your TCs in OASIS at:

https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php

Unless stated otherwise above:

IBM United Kingdom Limited - Registered in England and Wales with number
741598. 

Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU