Hi Philipp,
On 9/12/06, Philipp Bracher <[email protected]> wrote:
I would say that the name of the node should be the name of then bean
(name of the property or variable). Perhaps you have to provide a
name to the encode method:
myBean = new MyBean();
myBean.setName("gugu");
Encoder.encode(myBean, "myBean");
-->
>> <sv:node sv:name="myBean">
>> <sv:property sv:name="jcr:primaryType" sv:type="Name">
>> <sv:value>nt:unstructured</sv:value>
Indeed, we were thinking about that with Nicolas. OK.
Is there a reason for the prefix field_? I think we should avoid this
prefixes if possible to make the properties transparent. If we use
the code for the configuration we will have this field_ prefix
everywhere. I think we better use prefixes/namespaces for persisting
related information like the class or similar.
I used the "field__" and "entry__" prefix to avoid potential
collisions. Imagine a bean with setclass(c) and getclass() methods,
they would collide with the 'class' property of bean nodes.
But of course, a change in the point of view and the problem is solved
: the 'class' property could get renamed to something like
"bean__class" which is more safe (but not totally safe though).
About "entry__" I used it for arrays and collections, having
properties and nodes named "entry__0" to "entry__1". IIRC, I can use a
number as an item name and that would be OK.
About "entry__" and maps, I currently plan on enumerating the entries
(thus being OK with maps like LinkedHashMap). I couldn't use the
scheme were the key is used as a node name : keys could be beans as
well, so I store maps as lists of entry (nodes). I'd use the number as
the sub-item name.
WDYT ?
Another question : can I use a "owfebean:" namespace with
nt:unstructured nodes [and properties?] within Jackrabbit ? Within
Magnolia ?
Thanks in advance for the feedback and the replies,
--
John Mettraux -///- http://jmettraux.openwfe.org
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------