[Urgent] Digester and Configuration

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Urgent] Digester and Configuration

Sravan Duggaraju
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?

I really appreciate your responce.

Thanks
SanDi
Reply | Threaded
Open this post in threaded view
|

Re: [Urgent] Digester and Configuration

Jacob Kjome

I'm no expert, but I treat commons-configuration as a feature-rich replacement
for what I used to use plain old properties files for.  I don't really use
commons-digester much, but I've seen it used plenty and it seem to me that it
is usually used to map XML tags and attributes to classes and their
accessors/mutators.

So, if you want freeform properties, I'd use commons-configuration.  If you have
classes backing your configuration, then commons-digester is probably the thing
to use.

Jake

Quoting Sravan Duggaraju <[hidden email]>:

> 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?
>
> I really appreciate your responce.
>
> Thanks
> SanDi
>




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Urgent] Digester and Configuration

Hubert Rabago
I second what Jacob said, except I *have* used (and continue to use)
Digester, a lot.
I think this article
http://www.onjava.com/pub/a/onjava/2002/10/23/digester.html was what I
used to learn it.

Hubert

On 12/1/05, Jacob Kjome <[hidden email]> wrote:

>
> I'm no expert, but I treat commons-configuration as a feature-rich replacement
> for what I used to use plain old properties files for.  I don't really use
> commons-digester much, but I've seen it used plenty and it seem to me that it
> is usually used to map XML tags and attributes to classes and their
> accessors/mutators.
>
> So, if you want freeform properties, I'd use commons-configuration.  If you have
> classes backing your configuration, then commons-digester is probably the thing
> to use.
>
> Jake
>
> Quoting Sravan Duggaraju <[hidden email]>:
>
> > 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?
> >
> > I really appreciate your responce.
> >
> > Thanks
> > SanDi
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: [Urgent] Digester and Configuration

Marco Mistroni
In reply to this post by Sravan Duggaraju
Hello,
        I have also lot of xml config file and I try to use digester as much
as I can..

But  structure of my config files are not

Property=value

It's usually more 'complicated'

Like
<main>
  <elem1>
        <Props>
         <name>
         <value>
....

And usually I use an xml rule file that lists the rules to apply for
digester


With digester (though you are not forced to do that) you'll need do create
objects that will be mapped to xml elements (anyone pls correct me If I  m
wrong, but usually that's the way to go for digester)

Is It worth for your config files?

If yes, go for digester.....  

HTH
        marco

 
-----Original Message-----
From: Sravan Duggaraju [mailto:[hidden email]]
Sent: 01 December 2005 23:22
To: Jakarta Commons Users List
Subject: [Urgent] Digester and Configuration

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?

I really appreciate your responce.

Thanks
SanDi


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Urgent] Digester and Configuration

Simon Kitching
In reply to this post by Sravan Duggaraju
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Urgent] Digester and Configuration

Sravan Duggaraju
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 <[hidden email]> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Urgent] Digester and Configuration

Simon Kitching
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.

Regards,

Simon

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 <[hidden email]> 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:
>         [hidden email]
>         For additional commands, e-mail:
>         [hidden email]
>        
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]