I think you misunderstand the DRY principle. It's not "write every  
line of code only once" but "have a single point of responsibility for  
every functionality", often also called "single point of truth". Since  
the functionality is "validate the input for stage X in wizard Y and  
then save that data" it's perfectly DRY to have a separate action for  
each step of each wizard. You can always use config file inheritance  
or xincludes to have common validation in a single place. You can also  
use inheritance and composition to factor out common code into base  
classes or models used in multiple places.

There's a pretty good writeup about DRY in german here: 
http://www.ruby-mine.de/2009/5/27/repeat-yourself-hin-und-wieder

felix

On Sep 30, 2009, at 3:31 PM, Michal Charemza wrote:

>
> On 30 Sep 2009, at 14:21, Felix Gilcher wrote:
>
>> Why don't you use separate Actions for each stage?
>
> I was hoping to have things a bit more general: on this site there are
> in fact 2 separate wizards for different (but related) things. Plus,
> each stage is presented very similarly, and goes through a very
> similar action: validate the input, and go onto the next stage. It
> seems a bit non DRY to have each stage as a separate action. But would
> that be the preferred solution...?
>
> Michal.
>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.agavi.org/mailman/listinfo/users
>

--
Felix Gilcher

Bitextender GmbH
Paul-Heyse-Str. 6
D-80336 München

T: +49 89 57 08 15 16
F: +49 89 57 08 15 17
M: +49 172 840 88 28

[email protected]
http://www.bitextender.com/

Amtsgericht München, HRB 174280
Geschäftsführer: David Zülke, Florian Clever


_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to