On Wed, Aug 3, 2011 at 11:45 AM, Rickard Öberg <[email protected]> wrote: >> module.forMixin( Abc.class ).useDefaultsFor().someProperty(); > > Oh ok, I see. That should work, yes. But what is the issue with using > @UseDefaults on the interface? Are you saying "sometimes I want it sometimes > I don't"?
Think about it for a second; "USE defaults". So it is the "user" that defines whether it will want to centrally manage default values, and not the "creator" of the type. > The only issue I can see is that domain objects can "see" infrastructure. > But, I actually want it to. For example, if I have a concern that captures > calls for event-sourcing purposes, that concern lives in Domain layer, but > uses EventStore from infrastructure. If Domain does not see anything... > well, it would have to be "injected" from above layer somehow. But why do > that instead of simply allowing Domain to access infrastructure? > > The only solution I can think of is to have an Imported Service in the > domain layer which functions as a marker, e.g. an EntityStore, and then the > actual EntityStore is in a layer that uses the Domain layer and "injects" > itself when available. Then the Domain layer is isolated, in terms of "uses > layers", but can still use specific services that are required, like > EntityStore and EventStore. I am probably on the same side of the fence as you. Since we have full assembly control at boot time, it seems unnecessary to do 'injections' from an outer layer, which is somehow what must happen. Let's drop it. Cheers -- Niclas Hedhman, Software Developer http://www.qi4j.org - New Energy for Java I live here; http://tinyurl.com/3xugrbk I work here; http://tinyurl.com/24svnvk I relax here; http://tinyurl.com/2cgsug _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

