On Tue, Jul 6, 2010 at 21:54, Rickard Öberg <[email protected]> wrote:
> On 2010-07-06 19.10, Edward Yakop wrote: > >> I'm not really buying the "configuring mixin in assembly" concept. >> If I'm implementing a mixin, I obviously have a certain assumptions on >> available mixins in order for implementation to work. >> Having this mixin declared in the interface certainly communicate my >> intent better, promote reusable component by providing default >> implementation. >> > > Note that we are primarily talking about the case where we have an entity > already defined, and we want to add more methods to it, rather than add more > implementations of existing methods. > > Actually, we definitely need a new method in the assembly API, because > .withMixins() is supposed to add lists of mixins that are available as > implementations, whereas what we discuss now is almost exclusively about > adding new methods, i.e. the class being added needs to be an interface, not > a mixin class. > > So, one would do: > > module.addEntities(DomainFooEntity.class).withRoles(Some.class).withMixins(SomeMixin.class); > > where Some is the interface with role methods, and SomeMixin is the > implementation (if I don't like the default in Some or if there is no other > declared implementation). > > In general, to keep things aligned with DCI, I think I'd prefer "withRoles" > instead of "withAbilities" as previously discussed. What do you think? It feels more natural in terms of UL. Do you think that we needs to stop at withMixins() ? How do we address "For some roles, we would need x Concerns and x Side-effects to be declared?" Regards, Edward Yakop
_______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

