Paul Kay

Greenhorn
+ Follow
since Jan 04, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Paul Kay


Nice post Bhushan. So very true.

And the brilliant punchline ...

Bhushan Chhajed wrote:
Take keen interest and keep smiling when you see a post like this! Also don�t forget to reply�



Wish you all the best for next attempt.
- Paul
Thats a very respectable score, Congrats !
15 years ago
Hey Mihai,

You are absolutely right.

@Inject used to be javax.ejb.Inject before standardization of spec. They voted it out in favor of the more refined @Resource and moved it to the javax.annotation package.

You may not find any reference using @Resource for injecting a bean, just because you have @EJB particularly for that.

Incidentally, you can also use @Inject for injecting a bean.

@Inject is the most basic DI annotation, forming the basis of IoC. Most AOP/IoC implementations support @Inject along with other more specific DI annotations.

Kindly keep us updated about your valuable findings in the regard; along with your environment and attribute values, if possible.

And have a fantastic year ahead.

- Paul

Hey Jothi,

You are quite right there.

@Resource can inject a resource as well as a bean.
The resource can not be an 'unregistered' POJO.
You can inject registered POJOs. for eg, JSF managed beans.

You would be able to inject 'any' POJOs in the future release(most probably). Thats really gonna help a lot.
Anything registered in the JNDI and managed by the container can be injected. ( Container needs to create it )

@EJB can only inject local and remote beans.
@Resource can be used anywhere for eg. web tier to inject resources.
Interestingly, EJBs can also be injected into Application clients in ACC 'static' ally.

@Inject is also for DI. Its getting amusing now, isnt it?

OK, @Inject is like generic and takes only the jndiName whereas @Resource and @EJB are more specific and more configurable with attributes like sharable, resourceType , authenticationType etc.

@Resource can be used at class level whereas @Inject and @EJB are method and field level.

Hope this helps you.
Wish you a happy and successful New Year.

- Paul

Hey guys,

Cracked the SCBCD5 (80%) in two days, 17 hrs per day .

EJB 3 in action ( First 13 chapters )
SCBCD5 Study Guide by MZ ( Everything except the Appendix )

@MZ: You rock dude! Thanks for the notes.

Best wishes
- Paul Kay

15 years ago