And if we need to control an order in which actions are shown?
Ok, both approaches have their own benefits and drawbacks.
Originally Posted by Andrew Sazonov
What if we need to areas where we need to show actions? It seems that there should be logic in factory that which accept only specific ones And for different place you'll still need custom logic... and so on. I suppose it's simpler to have some reusable mechanism for that.
Yes, in general, that's possible... but what for? I don't think it's practical to consider Spring as closed ecosystem - all it internal architecture was created with assumption of further extension (I mean protected methods, factory methods, internal factories and policies) and it's pretty easy to customize or expand it as necessary (of course, if that's practical).
I simply suppose that for tasks we've solved, that approach supported by Inject4Spring was pretty convenient - sure thing, it's not a silver bullet and it will be hardly needed for all applications.