UrbanPro
true

Learn Java Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Use of Service Locator Pattern

M
Milan M.
16/12/2016 0 0

If we want to reuse the java code that should be the best approach w.r.t re-usability, maintanence and saving time to concentrate on our own businbess logic/requirement. In the similar approach many patterns has been evolved which gives developer a opennes to decouple the functional logic and deploy as plug and play which is so famous as plugins in programming world. 

The plugins gives developer feasibility to reuse and extend the existing/implemented features and get benefited with that. Using the Jars we can de-couple our object creation like factory pattern and create the object at runtime depends upon the implementing factory class available on classpath. Service locator also works in same way where service provider need to define a descriptor file with the full class name of its abstract class (or interface) which contains the information of URI and its corresponding full implenting class. This way the vendor can publish its factory and implementing class within jar and put on class path to automatically come into action.

Tomorrow, if requirement gets changed or we recommended to use any other factory then simply we can add the updated jar into appended classpath and if it will get loaded first then it will be in action. So it is so easy to directly plug & play with such user frindly pattern. Such patterns are mostly we can see with xml parsers.

 

0 Dislike
Follow 0

Please Enter a comment

Submit

Other Lessons for You

Tricks in Java
Find out the compatible and incompatible assignments class Qs1 { public static void main(String arg) { /* PART 1 int a=2.7f; // not ok int b=2.7;...

Introduction to Programming Languages
What is a Programming Language? A programming language is a formal computer language or constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages...

Spring - Dependency Injection (DI)
Spring - Dependency Injection (DI) DI is a framework which provides loose coupling in code. Here loose coupling means no hard coding of the object. Instead of hard coding, we will be injecting these object...

Why Are That Brilliant 5% Always Left Behind?
Be it in our school, our office or, in our life, we often come across some who are struggling to keep up to the expectations.Have you thought about them? They are lovely human beings, but somehow they...

How To Setup development Environment Of Java?
After installation of JAVA, we need to setup 2 environment variables. First one is JAVA_HOME and second is Path. Below steps to set up Java environment to compile & execute Java programs from command...
X

Looking for Java Training Classes?

The best tutors for Java Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Java Training with the Best Tutors

The best Tutors for Java Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more