On 8/3/11 01:15 , Niclas Hedhman wrote:
On Tue, Aug 2, 2011 at 4:04 PM, Rickard Öberg<[email protected]>  wrote:

The above should be possible. But, for the "normal case", i.e. I want a
string to default to "" or an integer to 0, or a List to be new ArrayList(),
it doesn't work as well. Now that Values can be defaulted as well, i.e.
"@UseDefaults Property<SomeValue>  foo()" will actually cause an instance to
be created, that definitely cannot be done through assembly. So,
@UseDefaults still has its place.

I think my suggestion is that useDefaults is moved from the interface
to the PropertyDeclaration, i.e.

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"?

Right, true, that can't be done, since the EntityStore is resolved from the
point of view of the Entity, which would have none available if pure onion
is used. Hmm... what would the benefit be with using onion compared to the
more hexagonal approach that we use now?

I am not sure if we are loosing too much or not. I am making an
observation. Perhaps it is as simple as recognizing that for
persistence we manage to hide it at a whole new level, on the z-axis
under the whole thing...

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.

/Rickard

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

Reply via email to