[Design the new POJO MicroContainer] - Re: OnDemand as an aspect
by alesj
"david.lloyd(a)jboss.com" wrote : What's the use case?
|
Any service that might be potential On_Demand activator.
e.g. let's say we have a cmd line console (which we do btw ;-))
I don't wanna instantiate all the stuff unless somebody actually uses it == connects to it's ssh SocketServer.
I would only install ssh deamon, while wrapping the Socket initalization logic
with MC's On_Demand activation mechanism.
This would then trigger full install of all other needed beans.
But this means my code must know MC,
no matter how simple we make the mechanism,
is still too intrusive and users will never wanna depend on MC api.
Which makes complete sense, as we always preach how transparent it should be to use IoC.
And any other service that would serve as an activatior would have to do the same,
which means a lot of copy/pasting, depending on the api that might even change (although it's a spi).
"david.lloyd(a)jboss.com" wrote :
| To me it makes more sense to restrict our usage of on-demand beans to deployments that are only activated if a user deployment consumes it declaratively (in other words, beans depend on beans; methods do not depend on beans).
|
That too.
But that's the job of a profile service.
Here we're talking fine grained stuff,
and ctor, method, field invocation makes a valid activation use case.
"david.lloyd(a)jboss.com" wrote :
| Also, and I only speak for myself here, I'm personally really hesitant to invest more into AOP, given that AOP appears to be at least one key source of the performance problems that we have right now.
|
Afaic this is not really investing into AOP, it's investing into aspects.
Or how else are you gonna make this transparent?
I doesn't need to be AOP at the end, if you're not calling dynamic proxies AOP.
We should provide a set of aspect, helpers, ... which could then be applied how ever the users want.
But with having tight AOP integration already in MC,
and it's not gonna go away any time soon,
we might as well provide this AOP based approach out-of-the-box.
Same way we do @JMX, @JndiBinding and Anil's @Password.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4228845#4228845
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4228845
15 years, 7 months