Forums Register Login

Cache in ServiceLocator

+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
Thanks for the answer. Sorry for late reply.
I'm doing laundry! Look how clean this tiny ad is:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 448 times.
Similar Threads
PetStore: Service Locator Pattern design question
static code?
ServiceLocator
ServiceLocator - issue when shared between two web app.
Location of ServiceLocator
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:20:11.