db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Jefferson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-204) Need attribute on field element for type
Date Tue, 15 Nov 2005 19:03:29 GMT
    [ http://issues.apache.org/jira/browse/JDO-204?page=comments#action_12357719 ] 

Andy Jefferson commented on JDO-204:
------------------------------------

Lets take the example of Collection. The element-type will be  java.lang.Object
(or the interface type when using interfaces). The element-implementation-type
will be the actual PC types stored there. Notice that I said types  (plural). The
user wants to store more than one PC type in the same collection, so they declare
it with element-type as Object. The point of then defining which PC types are
valid is to allow the JDO impl to manage the persistence of this collection.

The same applies to a field of type java.lang.Object (or an interface). The user
wants to store some PC type there. In one object it may be a PC type A. In
another object it may be a PC type B. The implementation-type (or field-type in
your case) will be the possible types that can be stored.

In the case of interfaces, we clearly have the "implements"  information to
provide this implementation definition, but the benefit of adding an attribute to
each field/collection/array etc is that the user can then restrict each field to
a subset of the possible implementations.

The TCK, as you currently have it, only typically has one "implementation type".
The real world has many implementation types and the user needs the flexibility
to select from them.

Now that I've mentioned that I have in mind plurals, maybe it would be better to
use XML properly and add a subelement to store the names of these PC
implementation types. It would work with an attribute, storing a  
comma-separated list of names, but then XML allows it to be done better than that.


> Need attribute on field element for type
> ----------------------------------------
>
>          Key: JDO-204
>          URL: http://issues.apache.org/jira/browse/JDO-204
>      Project: JDO
>         Type: Bug
>   Components: api20
>     Reporter: Michelle Caisse
>     Assignee: Craig Russell

>
> Need to supply instantiated type information for Object & Interface fields.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message