So I've been doing a lot of multiple mediation recently (which is really cool). Just tagging a whole lot of view objects with interfaces to give it lots of new functionality/abilities.
But when doing so a lot, I've had a couple of cases where mediators need to run a particular order.
But when mediating a view with 2 mediators. The order isn't what I expected to happen. I wanted to make sure code was run a particular mediator before another one.
Here is the current order:
Mediator A - preInitialize
Mediator A - initialize
Mediator A - postInitialize
Mediator B - preInitialize
Mediator B - initialize
Mediator B - postInitialize
Mediator A - preDestroy
Mediator A - destroy
Mediator A - postDestroy
Mediator B - preDestroy
Mediator B - destroy
Mediator B - postDestroy
Can I change it like so:
Mediator A - preInitialize
Mediator B - preInitialize
Mediator A - initialize
Mediator B - initialize
Mediator A - postInitialize
Mediator B - postInitialize
Mediator A - preDestroy
Mediator B - preDestroy
Mediator A - destroy
Mediator B - destroy
Mediator A - postDestroy
Mediator B - postDestroy
I'm working on the code now, but wanted to make sure there wasn't a reason for the previous method.
Hi, how about implement that behaviour like a toggled feature (e.g. in mediator map)? I think in some cases first behaviour a useful, and in other the second?
So I've been doing a lot of multiple mediation recently (which is really cool). Just tagging a whole lot of view objects with interfaces to give it lots of new functionality/abilities.
But when doing so a lot, I've had a couple of cases where mediators need to run a particular order.
You've made a cool initialize and destroy order.
But when mediating a view with 2 mediators. The order isn't what I expected to happen. I wanted to make sure code was run a particular mediator before another one.
Here is the current order:
Can I change it like so:
I'm working on the code now, but wanted to make sure there wasn't a reason for the previous method.