I think as previously stated, one of the biggest hurdles is the injection of run time services.
One of the important points to consider is what is actually going to happen with your domain object. If it will ever be serialized and de-serialized in another environment (replication, webflow-flow scope) then you *really* do not want to keep a handle on the dao.
I do not have a *nice* solution for this, and yes it would be really nice if there was a way of having all these things transparently injected for you.
BTW; I would still consider using an interface because it seems the child loading strategy isn't an inherent part of the parent.
If you *do* want magic injection (which again, I would think very carefully about) then you can always have an interface:
HibernateAware {
setSession(final Session session);
}
and have a HibernateInterceptor applied to every hibernate backed object .
What would be *really* nice is if we could get spring to load the hibernate objects for us and apply dependency injection, i.e. if the object you got out of hibernate was actually a spring proxy which did nothing other than dependency injection. Of course this isn't possible but hey
