Hi Niclas,

Thank you for your suggestion! I haven't had time to put it together yet, but 
I'll have a go at it during the week (busy schedule).

What I want to do is to have a RouteSpecification ValueComposite to enforce 
that 
@ Immutable Property<Location> origin() 
!= 
@Immutable Property<Location> destination()
upon instantiation (?) of the ValueComposite so that you can't create a 
RouteSpecification that is in an invalid state. Would you place such a check in 
the LifeCycle create method according to your suggestion too? Or is there a 
much simpler way to enforce unequality between two properties in a 
ValueComposite?

Cheers,
Marc

On 13/01/2011, at 01.09, Niclas Hedhman wrote:

> On Thu, Jan 13, 2011 at 1:34 AM, Marc Grue <[email protected]> wrote:
>> On 12/01/2011, at 01.41, Niclas Hedhman wrote:
>>> The handling of Property methods is not special hard-coded internals.
>>> If you look at Composite type, you will see that it has a
>>> PropertyMixin declared, which you can replace with your own
>>> implementation. So, I suggest that the Mixin extends PropertyMixin and
>>> then implements Lifecycle, that should work.
>> 
>> Since PropertyMixin is final I can't do:
> 
> Ok, I didn't recalled that. Class isn't bigger than you can clone it
> source wise... Isn't it beautifu????!??
> 
> @AppliesTo( { PropertyMixin.PropertyFilter.class } )
> public final class MyPropertyMixin
>    implements InvocationHandler, Lifecycle
> {
>    @State
>    private StateHolder state;
> 
>    public Object invoke( Object proxy, Method method, Object[] args )
>        throws Throwable
>    {
>        return state.getProperty( method );
>    }
> 
>    // + Lifecycle your methods
> }

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to