Niclas Hedhman wrote:
On Thu, Sep 24, 2009 at 9:49 AM, Rickard Öberg <[email protected]> wrote:
Niclas Hedhman wrote:
* org.qi4j.entity.Entity no longer has a unitOfWork() method. Call
Qi4j.getUnitOfWork( entity ) instead.
Is this because of tanglement? My code injects UOWF all the time to do
currentUnitOfWork() and I was actually considering replacing that with @This
Entity to get the UoW. When you say Qi4j.getUnitOfWork(entity) that is not a
static method right? I.e. I have to inject @Structure Qi4j api; instead? If
so, then I have to do two injections if I want to avoid the UOWF injection:
one for the API and one for the composite. Hm... not sure I like it.

Ok. Yes, entanglement is the reason. Fair point (double injections).
I'll check if we can stick it into the uowf instead. I think that is
very doable.

You mean getUnitOfWork(Entity)? Yes, that should not be a problem. I was looking at trying to avoid it altogether, is all.

Another option is to inject UnitOfWork directly, along the lines that Michael just suggested (but not using @Invocation). One possibility would be @State, so "@State UnitOfWork uow" in an Entity. That would be neat :-)

It pulls in a lot of implementation details to client-reachable code,
and set the stage for uncontrolled subclassing. I like to avoid it.

Fair enough.

/Rickard

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

Reply via email to