[jboss-dev-forums] [JBoss Microcontainer Development] - Re: Non-public field properties
kabir.khan@jboss.com
do-not-reply at jboss.com
Tue Nov 17 05:29:09 EST 2009
Thanks it works for private fields with ALL, and I'll get rid of the tests for private methods, setters and constructors.
"alesj" wrote :
| Wrt JSR330 I wouldn't follow all their rules,
| I would mostly use its annotations to unify the usage,
| hence increase portability.
|
Do you think I should implement @Scope and @Singleton?
| public class SimpleFieldBean
| {
| @Inject
| public Simple field;
|
| @Inject
| public Simple other;
| }
|
The way this is described is that in my original SimpleFieldBean example, if Simple has no annotations a new instance is injected for each use, i.e. field != other. If Simple has a @Scope annotated annotation, such as @Singleton, the same instance is injected, so field == other, which in effect is what we have now.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266025#4266025
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266025
More information about the jboss-dev-forums
mailing list