Basic Question: Dynamic Java Classloading
Posted on 2010-11-13
i have a basic question, because i'm a java beginner:
Im working on a web project and my servlet needs to access some data from some "information-provider".
I want to write my servlet independend to the information-provider so i'm building a "info-bridge" bean which implements an interface.
I want to use an XML file, where i can configure what "info-bridge" java bean should be used (a bit like the spring-bean config stuff).
So i have the following XML:
<information-interface class="myJavaPackage.myProject.bridges.provider1Bridge" />
What is the best way to load the class from my servlet? Is it Java Reflection or is there any other technique (because i read that java reflection is not very fast) or is there maybe any built-in feature of apache tomcat? What is common??
thx for your help and best regards