[Solar-talk] Architecture question

Travis Swicegood development at domain51.com
Sun Oct 1 06:43:54 PDT 2006


Howdy all,

Rodrigo Moraes wrote:
> On 10/1/06, Travis Swicegood <development at domain51.com> wrote:
>   
>> Ok, that's long enough for a Saturday night.  I'm a bit bored in case
>> you didn't notice :-)
>>     
>
> I like your suggestions about the submit method, but since it's
> Saturday night, I'll just add one more question about the Bookmarks
> actionAdd() method. I've been taking the approach to never have
> two-of-the-same forms in my apps, and merging add() and edit() methods
> in one, and the add would be a edit($id = 0) without parameter in this
> approach. Commonly I would have something like:
>
> public function actionAdd() {
>     $this->edit();
> }
>
> And of course take on count particular definitions for each method
> (texts and special checkings). This avoids duplication of form
> building / processing, or at least puts all the stuff in just one
> place, making maintenance easier. Bad idea?
>   


Not in my opinion, Rodrigo.  Actually, this is what I've done with other 
frameworks simply because an add is really just an edit without having 
data available.  This isn't a case of edit() taking on two roles, 
instead it's taking on the abstract role of displaying a form that works 
for both the add and edit actions.

-Travis


More information about the solar-talk mailing list