[Design the new POJO MicroContainer] - Re: DESCRIBE phase - Dependency builders for MC Beans
by jaikiran
"alesj" wrote : "jaikiran" wrote : But in the long term, shouldn't we be moving away from this default?
| |
| No, that's why it's called *transparent* AOP integration. ;-)
|
| You can only argue that the AOP mechanism is not performant enough,
| but that's as far as I agree with you.
| Although this comes with a cost, it does bring lots of nice features.
| They are mostly true in a sense of AOP; aspects, concerns separation, ...
| @JMX, @JNDI, @Password, @(add-your-own-metadata-here) are good examples of this.
| And if I was a user, that's what I would want too, out-of-the-box.
|
I am not against using AOP, where its needed :) In the current scenario, there was no way to tell MC that i did not want AOP
"alesj" wrote :
| But yeah, there should be a way to explicitly avoid this,
| and this is/can be achieved with this new DB per MD mechanism.
| And if there is a real demand for this "outside" programmatic usage,
| it's trivial to add new declarative way of using this.
"kabir.khan(a)jboss.com" wrote : An annotation could be used on the deployment or per bean, e.g. @NoAop
Yes, this now allows us a way to skip/override the defaults.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230384#4230384
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230384
16 years, 11 months
[Design the new POJO MicroContainer] - Re: DESCRIBE phase - Dependency builders for MC Beans
by jaikiran
"alesj" wrote :
|
| | DependencyBuilder dependencyBuilder = md.getMetaData(DependencyBuilder.class);
| | if (dependencyBuilder == null)
| | {
| | IgnoreAOP ignoreAOP = md.getAnnotation(IgnoreAOP.class);
| | if (ignoreAOP != null)
| | {
| | return basicDependencyBuilder;
| |
| |
|
| Or we could have @DependencyBuilderMarker, where you would define a DB class?
|
I guess, instead of checking two things in the metadata (a DependencyBuilder and a IgnoreAOP annotation), its better to just look for a single annotation which could be something along these lines (just some pseudo code):
@DependencyBuilder(value=DescribeAction.BASIC)
| public class MyMCBean
| {
| ...
|
public @interface DependencyBuilder
| {
| String value();
|
DescribeAction
| {
|
| public static final String BASIC = "org...blah..AbstractDependencyBuilder";
|
| public static final String AOP = "org.blah.AOPDependencyBuilder";
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230381#4230381
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230381
16 years, 11 months
[Design the new POJO MicroContainer] - Re: DESCRIBE phase - Dependency builders for MC Beans
by alesj
"alesj" wrote : "alesj" wrote :
| | And if there is a real demand for this "outside" programmatic usage,
| | it's trivial to add new declarative way of using this.
| This being one of them. :-)
| "kabir.khan(a)jboss.org" wrote :
| | An annotation could be used on the deployment or per bean, e.g. @NoAop
| |
Here, more stuff to test. :-)
| /** Basic dependency builder, no AOP */
| private DependencyBuilder basicDependencyBuilder = createBasicDependencyBuilder();
|
| /**
| * Create basic dependency builder.
| *
| * @return the basic dependency builder
| */
| protected DependencyBuilder createBasicDependencyBuilder()
| {
| return new AbstractDependencyBuilder();
| }
|
| /**
| * Get dependency builder.
| *
| * @param md the metadata
| * @param kernel the kernel
| * @return dependency builder
| * @throws Throwable for any error
| */
| protected DependencyBuilder getDependencyBuilder(MetaData md, Kernel kernel) throws Throwable
| {
| DependencyBuilder dependencyBuilder = md.getMetaData(DependencyBuilder.class);
| if (dependencyBuilder == null)
| {
| IgnoreAOP ignoreAOP = md.getAnnotation(IgnoreAOP.class);
| if (ignoreAOP != null)
| {
| return basicDependencyBuilder;
| }
| else
| {
| KernelConfig config = kernel.getConfig();
| dependencyBuilder = config.getDependencyBuilder();
| }
| }
| return dependencyBuilder;
| }
|
Or we could have @DependencyBuilderMarker, where you would define a DB class?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4230369#4230369
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4230369
16 years, 11 months