commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <>
Subject Re: [Urgent] Digester and Configuration
Date Sat, 03 Dec 2005 00:41:13 GMT
There is one final difference between Digester and XmlConfiguration that
I may as well note before this thread finishes.

Digester does reduce the dependencies of an application; the only code
that depends directly on Digester is the initialisation code, and
thereafter an application is accessing "its own" objects. Once
initialisation is complete, Digester code is no longer needed.

Using XmlConfiguration, however, means that *every* part of the app that
wants to access config data will contain direct dependencies on
org.apache.commons.configuration classes.

However digester's benefit comes at the cost of having to write Digester
rules. And if the data is being imported into "temporary" objects
written explicitly to represent the config data, then there's the price
of writing the associated classes too.

So as is often the case, which is better depends upon the goals and
constraints for your project.



On Fri, 2005-12-02 at 09:32 -0500, Sravan Duggaraju wrote:
> Thanks you very much for your suggestions.
> I decided to use Commons configuration for my application.Because i
> don't wan't to import all the required beans where ever iam going to
> use the XML Properties.
> Thanks
> SanDi
> On 12/2/05, Simon Kitching <> wrote: 
>         On Thu, 2005-12-01 at 18:21 -0500, Sravan Duggaraju wrote:
>         > Hi,
>         > I am using lot of XML configuration files for my new
>         application,And i was 
>         > searching for the tools to read the  structured properties.
>         > I found two tools commons -->digester and configuration.
>         >
>         > 1)Which one is the appropriate tool to read the
>         XmlConfiguration files. 
>         > 2)I did not find good examples(documentation) for Commons
>         > configuration.Where can i get the examples?
>         Digester is capable of creating and populating *problem
>         domain* objects
>         using the input xml. These objects can have real behaviour
>         appropriate 
>         to the problem domain. And it means that applications can
>         basically be
>         written first, then "digester enabled" later without much (if
>         any)
>         change to the objects built from the input data.
>         XmlConfiguration, as others have noted, loads data as some
>         pool of 
>         information that the "real" objects can consult. The objects
>         wishing to
>         configure themselves need to be modified to explicitly *look*
>         for their
>         associated data. For many uses, of course, this is the
>         simplest and most 
>         obvious approach.
>         There is some overlap, however. Some users of Digester simply
>         use the
>         rules to populate objects with nothing but getters/setters on
>         them which
>         essentially makes this the same as using XmlConfiguration. 
>         Note that I'm very familiar with Digester but don't know much
>         about the
>         Configuration project or XmlConfiguration.
>         Cheers,
>         Simon
>         --------------------------------------------------------------------- 
>         To unsubscribe, e-mail:
>         For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message