• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServiceLocator vs Dependency Injection

 
Víctor García
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

First of all, i don't speak english very well, i'm sorry.

If we have an managed bean (a JSF backingbean, for example) we can use DI to access to a remote ejb. This is simplier than ServiceLocator... but, we need to optimice the performance and the cost for establishing a conection with a remote interface is bad for performance, we need to cache the conection to remote interface. Can we get this by using DI? do we need a ServiceLocator for cache and improve the performance? could the web server cache the conection??

An other question, could we use de ServiceLocator from an backingbean?, i think that we need a bussinesdelegate to separate the bussines tier from an web tier object like a backingbean, what do yoy think??

Thanks in advance...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic