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: Issue 139: Add field-type attribute to field element
Date Sun, 13 Nov 2005 22:39:21 GMT
Hi Andy,

On Nov 11, 2005, at 10:52 PM, Andy Jefferson wrote:

> Hi Craig,
>> Proposal:
> <!ATTLIST field field-type CDATA #IMPLIED>
> I'm in total agreement on the need for a MetaData attribute for  
> this, and for
> arrays, and collections, and maps.
> My only issue is with the name(s) chosen.
> You have "element-type" being added for arrays of Object/interface.
> You have "field-type" for Object/interface fields.
> You also need something for Collection elements, and something for Map
> keys/values (Is this a separate Issue number ?)

We already have
<!ATTLIST collection element-type CDATA #IMPLIED>
<!ATTLIST map key-type CDATA #IMPLIED>
<!ATTLIST map value-type CDATA #IMPLIED>
<!ATTLIST array element-type CDATA #IMPLIED> (recently added)

> Using "element-type" for array gives issues when deciding what to  
> call the
> attribute for collections (since we already have "element-type" on
>  Collection). The user has defined a collection as containing  
> elements of
>  type
> java.lang.Object, and needs to specify the implementation types for  
> these
> elements to give the implementation a clue as to what it should  
> expect.
The field-type was intended to provide the same information as the  
existing xxx-type for collections and maps.

It sounds like you are thinking that you would like two different  
attributes, one for "element-type" and another for "implementation- 
type". Can you explain what the difference is? I only see the need  
for one value here: the type that can be stored in the field,  
element, key, or value.



> I would propose something more like the following
> <!ATTLIST field implementation-type CDATA #IMPLIED>
> <!ATTLIST array element-implementation-type CDATA #IMPLIED>
> <!ATTLIST collection element-implementation-type CDATA #IMPLIED>
> <!ATTLIST map key-implementation-type CDATA #IMPLIED>
> <!ATTLIST map value-implementation-type CDATA #IMPLIED>
> since the name is directed to what it is describing - the  
> "implementation
> classes" that can be stored in this interface/Object field.
> --
> Andy

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!

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message