jackrabbit-dev mailing list archives

On 11/1/07, Padraic Hannon <pih@wasabicowboy.com> wrote:
>
>
> I have been reviewing the implementation I submitted for mixin support
> in JCR-1100 and am struggling with how to proceed. On the one hand I
> think the implementation that was submitted is nice since it has some
> amount of type safety and gives the developer the ability to cast
> objects. On the other hand, how is a developer to know what to cast
> the objects to?
What do you mean ? For example, I don't see some problems when you search
on java class that match to mixin type.
I am starting to experiment with using the bean
> generator cglib code which will allow me to use regular javabeans. My
> idea is that the mapped node type would be used to instantiate the
> object and then for mixin properties I would create a new class
> dynamically which contains all the mixin's properties.
ok. I expect "mapped node type" is the primary node type - right ?
I would modify
> the object converter to first create the object with its nodes mapped
> properties then I would take each mixin for its node and grab the
> attributes for the mixin based on the mixin definition mapped in xml
> (not sure how to handle this in JDK 1.5 where the mappings are done
> with annotations)
It is done in the same way. This is the same ObjectConverter impl used in
both cases (annotation & xml).
and add these attributes to a new class which is a
> subclass of the node's defined class.
I don't understand why it is a sublcass of the node's defined class.
This new class would have
> properties defined for each property in the mixin.
>
> Has anyone else thought about how to handle this?
No yet I'm sorry. I will to review your proposal max for monday.
Christophe