Niclas Hedhman wrote: > Somehow this feels very strange. Perhaps my use-case is tainting my > objectivity but isn't it the Mixin itself that has "activation" and > "passivation" needs, and not the Composite? Only the Mixin knows what > resources it needs to allocate and free up. Why would the > ServiceComposite have a clue? And likewise, if more than one Mixin has a > need only one will be called, and can't deal with it unless one create a > strong relationship from one to the other.... > > That said, I realize that a Mixin would always have the same need, no > matter if it is part of a ServiceComposite or some other Composite, and > we can't fulfill such contract easily (or can we?). > > My proposal is that Activatable is checked on the Fragments and called > individually upon ServiceComposite activation/passivation.
Well, theoretically it should be possible to use concerns to do multi-mixin initialization, but it's going to be a bit of a hack. There is a precedent case for having callback methods per-mixins already though, which is initializable(). We could do the same with Activatable, but keep in mind that we have to handle some things, like if 3 mixins are activated, and the fourth fails, then the first three must be passivated, and so on. It's nothing strange (and Activator in SPI can do all of this anyway), but makes it a wee bit more complicated. So, iff we can get the semantics worked out, I'm +1. /Rickard _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

