Alas I can't read German..

However, I think I do disagree with what the "functionality" is in my  
case. I would say the the functionality is:

"Validate the input for the current stage, save the data, and move to  
the next stage"

But also: having a different action for each different stage would  
make it trickier to add stages later. Right now I have that stages  
defined in some simple php "config" code (order of stages, "nice"  
names of stages etc...), with associated template files for the forms  
themselves (It's a mild hack, but I think I can live with it). To  
add / remove stages later I can edit these files. If each stage is a  
different action, I would have to create a new action.

Michal.


On 30 Sep 2009, at 14:43, Felix Gilcher wrote:

> 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


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

Reply via email to