cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Allan Erskine <a.ersk...@cs.ucl.ac.uk>
Subject RE: [C2] allowing multiple additions with DatabaseAddAction
Date Tue, 15 May 2001 13:50:32 GMT
> complexity that doesn't really need to be there.  In other
> words if I used setString()
> for every parameter, it would be ok--but I was using natural
> types to do a rudimentory
> test for data correctness.

Hmmm.  I quite like all that datatype checking you did - I wouldn't want to
get rid of it, even if some of the time it is just cosmetic.

> How do you propose to do it differently to make it really
> work the way you want?

Well, the only thing that really needs to change for what I've done is to
remove the coupling to the request object in the setColumn method, and pass
its values as objects instead.

What I'm doing basically is just making multiple insert statements (one per
row, the columns being the string arrays of multiple request param values)
and committing them all at the same time.  There may be a faster way to do
this, but it seems OK to me.

> Sometimes there is a time for revolution instead of
> evolution.  When the current design
> can't support future needs, sometimes you need to refactor
> instead of kludge things together.

OK - I'll see how tidy I can make my kludging.  If it still looks as trashy
as it does at the moment, we can maybe try and think of a better way of
doing things.


> -----Original Message-----
> From: Berin Loritsch [mailto:bloritsch@apache.org]
> Sent: 15 May 2001 14:04
> To: cocoon-dev@xml.apache.org
> Subject: Re: [C2] allowing multiple additions with DatabaseAddAction
>
>
> > Allan Erskine wrote:
> >
> > I'm using a modified DatabaseAddAction that allows multiple
> additions for multi-valued parameters.  I've found it useful esp for
> > adding multiple entries for lists of checkboxes and
> multi-line selects.
>
> This sounds cool.
>
> > Unfortunately it involves using a modified
> AbstractDatabaseAction too (not too modified, still back
> compatible), and the way I've
> > gone about it seems really cludgy.  I have the feeling that
> the current DatabaseAction code wasn't really written with multiple
> > additions in mind.
>
> It wasn't.  That wasn't a need at the time I wrote it.  What
> I needed was a way to snag
> one page of information and put it in a database.  There is
> probably a certain level of
> complexity that doesn't really need to be there.  In other
> words if I used setString()
> for every parameter, it would be ok--but I was using natural
> types to do a rudimentory
> test for data correctness.
>
> How do you propose to do it differently to make it really
> work the way you want?
>
> > Does anyone else think that being able to add multiple
> records at a time is useful?  And if so, is there a better
> way of going
> > about it than cludgy hacks to the DatabaseActions?
>
> Sometimes there is a time for revolution instead of
> evolution.  When the current design
> can't support future needs, sometimes you need to refactor
> instead of kludge things together.
> That is why Cocoon 2 is so different than Cocoon 1.  There is
> no way that the sitemap would
> be able to be implemented in a sane manner in Cocoon 1--and
> many Cocooners like it that way.
> Both have the elegance of design that they need--but with
> different purpose.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message