On Sat, Oct 25, 2008 at 11:48 AM, Edward Yakop <[EMAIL PROTECTED]> wrote:
> There is problem with your implementation. Because origin is an
> immutable association.
> Hence, we would need to implement CargoMixin as:
>
> class CargoMixin
> implement CargoMixin
> {
> private CargoState cargoState;
>
> CargoMixin( @This CargoState cargoState, @Uses Location origin )
> {
> this.cargoState = cargoState;
> cargoState.origin().set( origin );
> }
> }
>
> If we look at CarrierMovement, where all its fields are immutable.
> Date type:
> CarrierMovement#to, CarrierMovement#from
> Location association:
> CarrierMovement#departureTime and CarrierMovement#arrivalTime.
>
> How are we supposed to initialize these fields?
So the "real use-case" (once all the noise and "solutions" are filtered out) is;
"Initialization of immutable private mixins are cumbersome and needs a
better solution."
CargoState state = builder.stateFor( CargoState.class );
:
:
I suspect this is currently not supported, but a lot easier to bring
up for discussion than tossing Property out, placing implementation
details in context interfaces and what not.
Cheers
Niclas
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev