Describe how to implement the locator-based method before(L) aswell as the locator-based method closest Before(k) in a dictionaryrealized using an ordered sequence. Do the same using an unorderedsequence implementation. What are the running times of thesemethods?
Answer
Answer:-
The service locator design pattern is used when we want tolocate various services using JNDI lookup. Considering high cost oflooking up JNDI for a service, Service Locator pattern makes use ofcaching technique. For the first time a service is required,Service Locator looks up in JNDI and caches the service object.Further lookup or same service via Service Locator is done in itscache which improves
OR
OR