jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Nuescheler <david.nuesche...@gmail.com>
Subject Re: Getting "custom" objects from the repository?
Date Sun, 17 Apr 2005 22:04:11 GMT
hi ben,

> Um, I'm not talking about anything like this...  I'm not even talking
> about adding any features to Jackrabbit or JCR or anything.  All I'm
> asking is, given that the majority of uses of content are likely to be
> more complex than just setValue()-getValue(), is there any scope for a
> pattern *on the client* (and *only* on the client, no caching, nothing
> special going over the connection, and using only the JCR API) that
> the expert group had in mind.  (Maybe the answer's 'no'?)

i think mapping of content to pojo's is not something that should
be covered in the jcr-spec at this point. much like the 
ejb (or jdo) and jdbc specs are separate for good reasons i 
believe this should be the same for jcr. 

personally, i think mapping that a nodetype to a bean-like-class
should initially be relatively straight forward. maybe it could be some
sort of class (or java source) generator.
i think the nodetype definition should provide a lot of
useful information for such a task. 

as a first step i would probably i would turn a 
properties into getters and setters (omitting the 
namespace information to prettify things a bit) .

so a nodetype myapp:image:

myapp:image
+ myapp:colorDepth long

would be turned into a class "Image" 
with methods 

setColorDepth(long) 
getColorDepth()
and maybe with constructors taking 
paths or uuid's

i think it could get very interesting assuming hierarchies of
child nodes and inheritance of nodetypes.
does that make sense? this could be the start of a 
poor-man's object-repository-mapping.

> Please don't think I underestimate (or even claim to have a broad
> knowledge of) the JCR use cases!  All I'm asking is, how do I write a
> program that talks to a repository where I can say
> Image.getColorDepth() rather than having to know the name of the
> property.  Not hard...  I don't have astronomical aspirations here...
> As I say in another thread, it's the APIs and only these that bother
> me, as someone who's going to have to work with JCR client libraries.
> Remember, *only the client*!  I'm a lazy client-side programmer -- how
> is my experience of working with a repository made easier?  Maybe I'm
> being a bit blue-sky here.

no, i think this is all very reasonable, and i think that if something
like the above is what you are looking for, then this should be 
implemented reasonably fast. would that be something that 
you are interested in working on? 

regards,
david

Mime
View raw message