?
Solved

Basic Question: Dynamic Java Classloading

Posted on 2010-11-13
4
Medium Priority
?
450 Views
Last Modified: 2012-05-10
Hi there,

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:
<config>
  <information-interface class="myJavaPackage.myProject.bridges.provider1Bridge" />
<config>

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
manuel
0
Comment
Question by:mesX
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 1000 total points
ID: 34127287
Reflection is fine - you shouldn't have to load the class very often anyway
0
 
LVL 92

Assisted Solution

by:objects
objects earned 1000 total points
ID: 34129006
0
 

Author Closing Comment

by:mesX
ID: 34134289
Thx for your quick responses and Tips!


regards!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 34134984
:)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question