Hi

Each framework has its own set of annotations to insert objects.
1) OSGI bluprint have annotation @Bean
2) Spring have annotation @Autowire
3) CDI Weld and Guice have annotation @Inject
4) EJB have annotations @EJB and @Resource
This zoo annotations are not universal.

I'm not looking Varant use annotations in project.
As an example, take the JUnit test.
Hard to raise test Java EE and WEB, to test the CDI (Weld).
Hard to raise test OSGI Enterprise V4.2.
It is easier to raise the Spring. A little harder to Guice.

I offered a small revision. Instead of code
  Bean bean = CamelContextHelper.mandatoryLookup (getContext (), "bean",
Bean.class);
we can write beautifully
  @BeanInjection ("bean") Bean bean;

As an example of similar implementation, I show the work of the annotation
@PropertyInject.
Instead of code
   String stringValue = CamelContextHelper.parseText (getContext (),
"{{property_a}}");
   int intValue = CamelContextHelper.parseInteger (getContext (),
"{{property_b}}");
we can write beautifully
   @PropertyInject ("property_a") String stringValue;
   @PropertyInject ("property_b") int intValue;

So the code looks beautiful. It is necessary to do so that your work is not
only worked well, but also look nice.


Aleksey



--
View this message in context: 
http://camel.465427.n5.nabble.com/Propose-add-annotation-BeanInject-tp5742782p5743064.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to