You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Michael Schuerig <mi...@schuerig.de> on 2004/11/07 00:08:40 UTC

[Digester] Digesting into a database

I have written a couple of rules and support classes for Commons 
Digester that help to abuse it in an interesting way. Instead of 
creating application objects, now the digester inserts rows into a JDBC 
database.

At the current stage, the code _works for me_(TM). If you look at it too 
sharply, you may cut it into pieces. As yet it works with HSQLDB. 
Adaptation to another DBMS requires implementing an interface, which is 
no big deal presumably.

I'm not sure about the future of this thing. I don't promise to develop 
it any further. As is, the functionality has proven useful to me, 
possibly its useful to others, too.

With all these caveats in place, have a look at the (minimal) javadocs 
and get the source+binary zip at

http://www.schuerig.de/michael/java/dbdigester

Michael

-- 
Michael Schuerig                           The more it stays the same,
mailto:michael@schuerig.de                        The less it changes!
http://www.schuerig.de/michael/      --Spinal Tap, The Majesty of Rock

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [Digester] Digesting into a database

Posted by Michael Schuerig <mi...@schuerig.de>.
On Monday 29 November 2004 08:42, Simon Kitching wrote:
> On Sun, 2004-11-07 at 12:08, Michael Schuerig wrote:

> > http://www.schuerig.de/michael/java/dbdigester

> I finally got around to having a look at your code this evening;
> sorry it tooks so long.
>
> Unfortunately I feel that what you have created is too complicated to
> be an 'example' of Digester usage. I think that eighteen classes
> (with some non-trivial interaction between them) is rather a lot to
> inflict on some poor soul trying to figure out whether Digester is
> for them :-).

That's definitely true. The code wasn't primarily meant to be a 
demonstration good digester usage.

> And I don't believe that database-insertion functionality would fit
> well in the digester core. The core really should be as generic as
> possible; the database stuff is more an application of the digester
> than a framework for others to build upon.

The database code doesn't require any changes to the core. From the 
point of view of the basic digester framework, my code is just another 
user.

With your second point I don't agree. The digester database extension 
("dbdigester") could be made to be fairly generically usable by others. 
I don't claim that it already fulfills that promise as I have only used 
it for my own possibly narrow purposes. In the unlikely event that 
others have looked at the code, I'd like to hear their comments.

> It might be best for this code to reside on your site as currently; I
> would be happy to have a Wiki entry point to it, if you wish, under
> the titles "more advanced worked examples" or similar. You probably
> need to add some more documentation to what you currently have,
> though, to make it useful to people following that link.

I'm slowly adding some more documentation as I go. A link would be fine.

To my mind, dbdigester should not be seen as an example of using 
digester. It wouldn't serve that purpose well. Rather, I see it as an 
extension of the core functionality. My aim is to make it easily usable 
without a need to look at its innards.


Michael

-- 
Michael Schuerig                  There is no matrix,
mailto:michael@schuerig.de        only reality.
http://www.schuerig.de/michael/   --Lawrence Fishburn

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [Digester] Digesting into a database

Posted by Simon Kitching <si...@ecnetwork.co.nz>.
On Sun, 2004-11-07 at 12:08, Michael Schuerig wrote:
> I have written a couple of rules and support classes for Commons 
> Digester that help to abuse it in an interesting way. Instead of 
> creating application objects, now the digester inserts rows into a JDBC 
> database.
> 
> At the current stage, the code _works for me_(TM). If you look at it too 
> sharply, you may cut it into pieces. As yet it works with HSQLDB. 
> Adaptation to another DBMS requires implementing an interface, which is 
> no big deal presumably.
> 
> I'm not sure about the future of this thing. I don't promise to develop 
> it any further. As is, the functionality has proven useful to me, 
> possibly its useful to others, too.
> 
> With all these caveats in place, have a look at the (minimal) javadocs 
> and get the source+binary zip at
> 
> http://www.schuerig.de/michael/java/dbdigester
> 

Hi Michael,

On Sun, 2004-11-07 at 12:08, Michael Schuerig wrote: 
> I have written a couple of rules and support classes for Commons 
> Digester that help to abuse it in an interesting way. Instead of 
> creating application objects, now the digester inserts rows into a JDBC 
> database.
> 
> At the current stage, the code _works for me_(TM). If you look at it too 
> sharply, you may cut it into pieces. As yet it works with HSQLDB. 
> Adaptation to another DBMS requires implementing an interface, which is 
> no big deal presumably.
> 
> I'm not sure about the future of this thing. I don't promise to develop 
> it any further. As is, the functionality has proven useful to me, 
> possibly its useful to others, too.
> 
> With all these caveats in place, have a look at the (minimal) javadocs 
> and get the source+binary zip at
> http://www.schuerig.de/michael/java/dbdigester
> 

I finally got around to having a look at your code this evening; sorry it tooks so long.

Unfortunately I feel that what you have created is too complicated to be
an 'example' of Digester usage. I think that eighteen classes (with some
non-trivial interaction between them) is rather a lot to inflict on some
poor soul trying to figure out whether Digester is for them :-).

That's not to say that there is anything wrong with your code; I just
don't know quite how the Digester project could make use of it. We do
have one largish "worked example" currently in CVS, being the RSS
parser. But I'm not wild on having even that; keeping it functional
between releases is non-trivial.

And I don't believe that database-insertion functionality would fit well
in the digester core. The core really should be as generic as possible;
the database stuff is more an application of the digester than a
framework for others to build upon.

It might be best for this code to reside on your site as currently; I
would be happy to have a Wiki entry point to it, if you wish, under the
titles "more advanced worked examples" or similar. You probably need to
add some more documentation to what you currently have, though, to make
it useful to people following that link.

Anyway, this is just my personal opinion. If you disagree, feel free to
say so and see if other commons developers have alternative viewpoints.

Regardless, I see you are a regular on the commons lists, and hope to
see other contributions from you in the future..

Regards,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [Digester] Digesting into a database

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On 7 Nov 2004, at 22:07, Michael Schuerig wrote:

> On Sunday 07 November 2004 22:56, Simon Kitching wrote:
>> On Sun, 2004-11-07 at 12:08, Michael Schuerig wrote:
>>> I have written a couple of rules and support classes for Commons
>>> Digester that help to abuse it in an interesting way. Instead of
>>> creating application objects, now the digester inserts rows into a
>>> JDBC database.
>>
>> Thanks for the posting. I've been meaning to add an example like this
>> to the current digester examples. I consider this completely fair use
>> of Digester, and not "abuse" at all :-)
>>
>> I'll have a look at your code later, with a view to adding it as an
>> example, if that is ok by you...
>
> Of course, that's the point of it :-) I hope I've put an Apache licence
> everywhere it's necessary.

that sounds great :)

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [Digester] Digesting into a database

Posted by Michael Schuerig <mi...@schuerig.de>.
On Sunday 07 November 2004 22:56, Simon Kitching wrote:
> On Sun, 2004-11-07 at 12:08, Michael Schuerig wrote:
> > I have written a couple of rules and support classes for Commons
> > Digester that help to abuse it in an interesting way. Instead of
> > creating application objects, now the digester inserts rows into a
> > JDBC database.
>
> Thanks for the posting. I've been meaning to add an example like this
> to the current digester examples. I consider this completely fair use
> of Digester, and not "abuse" at all :-)
>
> I'll have a look at your code later, with a view to adding it as an
> example, if that is ok by you...

Of course, that's the point of it :-) I hope I've put an Apache licence 
everywhere it's necessary.

As I said before, I'm grateful for corrections, improvements and 
comments.

Michael

-- 
Michael Schuerig                  Failures to use one's frontal lobes
mailto:michael@schuerig.de        can result in the loss of them.
http://www.schuerig.de/michael/   --William H. Calvin

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [Digester] Digesting into a database

Posted by Simon Kitching <si...@ecnetwork.co.nz>.
On Sun, 2004-11-07 at 12:08, Michael Schuerig wrote:
> I have written a couple of rules and support classes for Commons 
> Digester that help to abuse it in an interesting way. Instead of 
> creating application objects, now the digester inserts rows into a JDBC 
> database.

Thanks for the posting. I've been meaning to add an example like this to
the current digester examples. I consider this completely fair use of
Digester, and not "abuse" at all :-)

I'll have a look at your code later, with a view to adding it as an
example, if that is ok by you...

Cheers,

Simon



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org