• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cache in ServiceLocator

 
Sreenath Madasu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
In the ServiceLocator, is it better to have a local cache of the services or can we cache the services as session attributes?
 
Alex Sharkoff
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sreenath,

Go with the local cache.

In this case all of the service locator logic is encapsulated in one place and does not rely on anything else (eg, session attributes).

You can use such locator implementation with the different application configurations ( that would be the case when you need to build a standalone version of your application, then you'd implement a new type of a View , eg swing, and a new type of controller, eg plain old java object rather than servlet, but leave all the rest things, model/service locators/etc, in your application untouched).


Hope it helps,


[ December 20, 2004: Message edited by: Alex Sharkoff ]
 
Sreenath Madasu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the answer. Sorry for late reply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic