In expectation of newly developed extensions to JDK, I am looking
at possible ways of taking advantage of the APIs--especially if
they are going to be a core part of the API.

Of particular interest are the Java Prefs package (java.util.prefs),
Java Logging (java.log), Java Generics (these are cool), JDBC 3.0,
and Assertions.

Here is a quick summary of my understanding of these technologies,
and what I think about them:

Java Logging
------------
We all know and loathe this one.  We should team up with Log4J to
get the best logging implementation possible.  Ceki seems pretty
reasonable on this one (esp. since we are hosted by the same
organization).  We should also find someone to be involved in
Java Logging's next version/JSR.

Java Prefs (java.util.prefs)
----------------------------
This is comming out in JDK 1.4.  It is an interesting replacement
for Properties.  It suffers from two major drawbacks: it is
read/writable like Properties, and it is complex.  I don't like
the API, but it does offer functionality that our Configuration elements
offer.  We might consider writing a wrapper that uses this API for
the BackEnd, and still keep our Configurations and Parameters for
the FrontEnd.  Another drawback to this API is the predisposition
to a Java specified configuration file that makes no sense.  It reads
and writes XML, but the markup looks something like this:

<preferences>
  <!-- the other type is "user" -->
  <root type="system">
    <map>
      <entry key="myKey" value="My Value"/>
      <entry key="key2" value="My Other Value"/>
    </map>
    <!-- there can be any number of nodes, and they can be nested -->
    <node name="level2">
      <map>
        <entry key="level2Key" value="New Level 2 Value"/>
      </map>
      <!-- please note that all nodes MUST come after the map -->
    </node>
  </root>
</preferences>

The required preferences are accessed like this:

Preferences rootPrefs = Preferences.systemRoot();
Preferences level2Prefs = rootPrefs.node("/level2");

And the kiss of death:

Preferences parentPrefs = level2Prefs.parent();


Generics
--------
Generics are Java's answer to the C++ template system.  They are compile-time
expanded and checked, which reduces bloat, and increases the chance that what
we want is what we get.  This is in the JDK 1.4 compiler, but disabled until
JDK 1.5.  Generics will help make our ComponentSelector even more friendly.
It will also help us protect our pools and other generic interfaces.

JDBC 3.0
--------
We need to support this.  It will require more methods in the JDBC Connection
property.  There may be a way to use the driver's pooling code if it exists.
This is something we need to investigate.

Assertions
----------
This will be available in JDK 1.4.  Assertions are the developer's friend if
used wisely, and his enemy if used foolishly.  This is something we should take
advantage of in the future.

S/MIME Cryptographic Signature

Reply via email to