Name: gm110360 Date: 06/10/2002
FULL PRODUCT VERSION :
[charisma mprudhom]$ java -version
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
FULL OPERATING SYSTEM VERSION :
Linux charisma 2.4.17 #5 Tue Apr 9 16:19:04 EDT 2002 i686
unknown
A DESCRIPTION OF THE PROBLEM :
A common problem for many applications that interoperate
with other components is that there is no standard for
locating implementations of common interfaces. For example,
if I have an application that works with any JDBC driver, I
have to either:
1. Hardcore all the possible JDBC driver class names into
my application, or
2. Ask the user to enter the class name of their JDBC driver.
3. Parse the classpath and scan through all the jar files
and instantiate each class to check to see if it implements
the java.sql.Driver interface.
#1 and #3 are bad for obvious reasons. #2 is confusing to a
user who is not technically inclined.
One proposed solution would be very simple: just create a
standard whereby the manifest of a jar file may contain a
list of implementing classes that the jar author wants to
advertise. For example, the JDBC driver for MySQL could contain:
java.sql.Driver: org.gjt.mm.mysql.Driver
Optionally, a method could be added to the
java.util.jar.JarInputStream class that does something
like:
Class [] getImplementingClasses (Class interfaceClass)
A standard like this would vastly improve the current
situation with regards to component-based programming, and
the implementation effort would be minimal: it would mostly
involve documenting the standard.
This bug can be reproduced always.
(Review ID: 146517)
======================================================================