Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB annotations at the client side  RSS feed

 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I remember readin an article sometime back that EJB annotations can only be used at the server side and not at the client side. This would mean that client code would still have the JNDI lookup code. why hasn't sun taken care of this ?
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you going to get an EJB ref if you don't know where to get it from?
That's what the JNDI lookup is for.

If you want you can use something like Spring to put an abstraction layer around it.
 
Merrick Schincariol
author
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pradip,

Java EE clients support dependency injection into static fields. So a remote EJB client can inject the bean reference without having to use JNDI.

Cheers,

Merrick
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Merrick
 
Alexandros Stivaktatis
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Merrick Schincariol:
Java EE clients support dependency injection into static fields. So a remote EJB client can inject the bean reference without having to use JNDI.


In the scenario above who is responsible for the naming and directory services?

Bye,

Alex
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alexandros Stivaktatis:


In the scenario above who is responsible for the naming and directory services?

Bye,

Alex


Same as before. The EJB server. The only difference is that the client does not have to do the lookup.
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, the client still needs to do the lookup, but the actual implementations are hidden in the framework you're deploying as part of your application.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeroen T Wenting:
well, the client still needs to do the lookup, but the actual implementations are hidden in the framework you're deploying as part of your application.

I meant that the client does not have to write the lookup code.
 
Alexandros Stivaktatis
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it correct to say that the Service Locator pattern is in
this way introduced in the framework that is being deployed,
whereas previously this design choice was left completely in
the hands of the developers?

Alex
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alexandros Stivaktatis:
Is it correct to say that the Service Locator pattern is in
this way introduced in the framework that is being deployed,
whereas previously this design choice was left completely in
the hands of the developers?

Alex


Yeah, no more ServiceLocator pattern.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry ab out the lack of knowledge but... how do you do then ?
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
Sorry ab out the lack of knowledge but... how do you do then ?


I guess you'll know that after reading the book
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!