On Mon, Mar 2, 2009 at 12:16 PM, Rickard Öberg <[email protected]> wrote:
> Hey,
>
> The more I look at the UoW event system the more bizarre it seems, and
> "old fashioned" compared to everything else.
YES, I have also long wondered if we should apply Qi4j concepts
internally to the Qi4j Runtime, and UoW is a first obvious case.
> So here's an idea: what if
> we apply the notion of concerns and sideeffects to UoW as well, i.e.
> another level to declare them.
Yes...
> One obvious problem is how to declare these concerns though. If they are
> declared on the Usecase of the UoW, then it would have to be as classes,
> i.e.
> Usecase uc = UsecaseBuilder.buildUsecase("Some
> usecase").withConcerns(PropertySetterConcern.class).newUsecase();
> UnitOfWorkFactory uowf = ...;
> UnitOfWork uow = uowf.newUnitOfWork(uc);
Another idea would be to create separate UnitOfWork composites,
associate each with a UseCase. I am not that fond of the 'runtime'
aspect of the above...
> There is also the question of granularity. In the above case the concern
> will be applied to pretty much all properties in a UoW, i.e. there's no
> way to say "I want to listen to property Foo in Entity SomeType:123".
> This could, however, be implemented on top of a generic concern that
> only provides the listener functionality in general.
Yes, I don't think that is a massive problem. Programmatic filters
should be enough.
> Should I attempt to implement this? Would it be better than the current
> general event listener scheme? I feel that we really do need some kind
> of event system...
Yes on both accounts. The 'current' event system is messy like nothing
else, and I wonder if that is a symptom that this is harder than we
think or just the regular Ball Of Mud entropy...
Cheers
Niclas
--
http://www.qi4j.org - New Energy for Java
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev