[Catalyst] Why scaffolding? Validation and Learning
Brian Kirkbride
brian.kirkbride at deeperbydesign.com
Thu Aug 17 19:01:34 CEST 2006
Zbigniew Lukasiak wrote:
> This is the first advantage of scaffolding - easy evaluation.
>
I would agree with this. It's not the first thing that occurs to me when I
think of scaffolding, but perhaps it should be.
> The other important advantage is that it helps in the learning process.
> You get a non trivial working example. And again this example is based
> on your database schema - from the starting point you at once know much
> about the program.
>
Very true, as long as the generated code is well-documented and becomes a
"custom tutorial" sort of thing. That would be good, whereas the more
Rails-like mode of CRUD being based entirely on defaults that are hidden to the
new user is bad IMHO.
> Of course there are also disadvantages to code generation.
I think that these disadvantages are certainly what framework devs and
experienced users think of when they think of scaffolding. And the Rails
mindset has made that even more likely.
I *really* like your idea about separating the scaffolding from any additional
code the new user might add. Perhaps the CRUD generator creates a base class
for each controller that can be updated to sync with model changes, while an
(initially empty) controller subclass holds their new code?
For me the thing that absolutely sunk Rails was that too much happened
automatically, behind the scenes. A split controller/subclass might allow the
developer to see how things work (visible magic as opposed to invisible magic),
but not mix their code up in that.
- Brian
More information about the Catalyst
mailing list