in reply to Squatting::On::Catalyst and Truly Modular Web Apps

I like Squatting quite a bit John. It seems about as nice as my favorite CGI::Prototype. I have some comments to make about the docs here.

controller did model things

In the SYNOPSIS where you show a basic app, we see the following in the controller:
# STEP 2 => Create a Controllers package { package App::Controllers; use Squatting ':controllers'; # Setup a list of controller objects in @C using the C() function. our @C = ( C( Home => [ '/' ], get => sub { my ($self) = @_; my $v = $self->v; $v->{title} = 'A Simple Squatting Application'; $v->{message} = 'Hello, World!'; $self->render('home'); }, post => sub { } ), ); }
But I dont think $v->{title} or $v->{message} are view. They should have been pulled from the model by the view. And they certainly dont belong in the controller, whose only job is to pick a particular model and view and let them do the work.

Replies are listed 'Best First'.
Re^2: Squatting::On::Catalyst and Truly Modular Web Apps
by beppu (Hermit) on Aug 14, 2008 at 21:06 UTC

    Hey, man. It's been a while. Hope you're well. :)

    Anyway...

    You bring up a good point. $self->v is the equivalent of Catalyst's stash. However, now that you bring this up, I think "v" was not the best name for this hashref. The mnemonic I had in mind was "v" for "variable", but I can see how it can be ambiguous with "V" for "View". Ah fuck. ;-)

      I think "v" was not the best name for this hashref. The mnemonic I had in mind was "v" for "variable", but I can see how it can be ambiguous with "V" for "View". Ah fuck. ;-)
      heh. maybe there could be an alias like $self->stash

      But I think Brock or you would be in a better position to actually decide on the verbose descriptive non-deceptive alias than me.