db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neeme Praks <ne...@apache.org>
Subject org.apache.ojb.broker.util.configuration vs. org.apache.avalon.framework.configuration?
Date Wed, 23 Apr 2003 12:07:29 GMT

While browsing through OJB source code to find an easy way to write an 
OJB component for Avalon containers, I can across the following TODO item:
merge with jakarta commons-configuration API

While this looks like a sensible idea at first sight, I have a different 
opinion: OJB should use Avalon framework API interfaces instead of 
commons configuration API interfaces.

Both OJB and Avalon framework configuration interfaces support 
"inversion of control" pattern, commons configuration doesn't.
As a result, it would be quite painless to do the following conversion:

org.apache.ojb.broker.util.configuration.Configurable ->
easy match, 1-1 mapping

org.apache.ojb.broker.util.configuration.Configuration ->
here we have some differences:
Avalon is missing:
    Class getClass(...); //this seems like an implementation detail, why 
is this exposed in the interface?
    String[] getStrings(...); //this could be replaced by Avalon support 
for child values
Avalon has additional support for XML conf:
    attributes, values, namespaces, children.

org.apache.ojb.broker.util.configuration.ConfigurationException ->
one difference: OJB has protected ConfigurationException(String key, 
String message), but as this is protected, this should not be an issue.

This interface has no real equivalent in Avalon and should probably stay 
with OJB. However, the configurator implementations can probably take 
advantage of the following avalon helper classes:

If you would be interested, then I could try to convert OJB to use 
Avalon interfaces (or maybe after 1.0)? If not, then I will write some 
glue code to adapt avalon configuration to OJB interfaces.


View raw message