incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandro Böhme <s.boe...@inovex.de>
Subject Re: Mapping of Items
Date Mon, 21 Mar 2005 14:47:49 GMT
Hello,

the basic idea is, to use the bean class structure as the master and 
create the nodetypes according to the bean classes. E.g it could be 
possible to create the beans out of an uml tool.
At the moment I can imagine the following use cases:
a) creating the nodetype structure at design time
b) reading beans from nodes at runtime
c) writing beans to nodes at runtime
d) persist beans to the persistance layer
e) maintaining the bean structure (rename beans or properties, delete 
beans or properties, change the type of the bean or property...)

I think use case e) need some definition (specification like xdoclet,... 
or a user interface) what to do with data whose type has changed. So I 
would think about further until the basics work.
I'am sorry in advance, because I have not that much spare time, so it 
will need some time until I can complete some tasks. But I will do my best.
First I would like to create a textual mapping between JCR features and 
Java features like:
Mixin = Interface
Node Type Name = Class Name
isMixin = this.getClass().isInterface()
...

some initial ideas:
a) Maybe we can use the Struts bean introspection to check the beans, 
create the nodetypes out of that information and registering them. Too 
bad, that creation and registering of nodetypes is not part of the 
JCR-spec :-(.
b) With
bean class name 	equals node type name and
bean property name 	equals child node name or property name
it should be possible to use the JCR introspection to get the node values.
Maybe we can provide the data by a generic
Object getProperty(Object beanObject, String propertyName); method.

c) Similar to b)
Maybe we can set the data by a generic
void setProperty(Object beanObject, String propertyName); method.

d) We could provide two save methods like saveBean(Object beanObject) 
and saveBeanProperty(Object beanObject, String beanProperty).

When I thought about mapping a bean class graph to a persisting graph I 
thought this problem should be already solved some years ago by object 
databases. So I will do some research if there are some tools/concepts 
which will work in our use cases.
What do you think about all this?

Best regards,

Sandro

Oliver Kiessler wrote:
> On Fri, 18 Mar 2005 21:39:30 +0100, Christophe Lombart
> <christophe.lombart@sword-technologies.com> wrote:
> 
>>Sandro Böhme wrote:
>>
>>
>>>Hello Christophe,
>>>
>>>at the jackrabbit mailing list you said, you may want to implement a
>>>mapping layer between java objects and node objects. If there is
>>>nothing yet started in this direction I would try to implement a first
>>>version of it. If there is already some work done, I would like to
>>>participate, if you want.
>>>
>>>Best regards,
>>>
>>>Sandro
>>>
>>
>>Olivier Kiessler is working on that (see on
>>http://www.techblogs.de/roller/page/okiess). You are welcome to join
>>us.  It should be nice to see ASAP a proposal on that topic.
> 
> 
> Yes, I have written some code for JCR object persistence/mapping. It
> is not officially available yet, but if you are interested to join in
> or have a look at it, you are very welcome. Let me know and I'll send
> you the source code.
> 
> regards,
> oliver
> 
> 

Mime
View raw message