jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Lombart" <christophe.lomb...@gmail.com>
Subject Re: dynamic mixins and jcr mapping
Date Wed, 29 Aug 2007 18:27:57 GMT
cool this is the fist time that I see a horse which can bark :-)
You are welcome to share your investigation. thanks

Christophe


On 8/29/07, Padraic I. Hannon <pih@wasabicowboy.com> wrote:
>
> I was playing with cglib over the last few days and found their mixin
> proxy. Using that I was able to do a simple test:
>
> Dog dog = new DogImpl();
> Cat cat = new CatImpl();
>
> Object[] delegates = new Object[2];
> delegates[0] = dog;
> delegates[1] = cat;
> Object mixed = net.sf.cglib.proxy.Mixin.(delegates);
>
> System.out.println(((Dog)mixed).bark());
> System.out.println(((Cat)mixed).meow());
>
> Seems to work fine. You can even add a mixin to a mixin...
>
> Horse horse = new HorseImpl();
> delegates[0] = mixed;
> delegates[1] = horse;
> mixed = net.sf.cglib.proxy.Mixin.(delegates);
>
> System.out.println(((Horse)mixed).neigh());
> System.out.println(((Dog)mixed).bark());
>
> I was thinking that one could create base classes which would be mixin
> implementations and add those during de-serialization from ocm or even
> at runtime to node objects. I'll keep playing and get back with more
> once I have something more concrete.
>
> -paddy
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message