[Catalyst] Parametrized examples

Zbigniew Lukasiak zzbbyy at gmail.com
Wed Nov 16 11:32:40 CET 2005


Hi,

In my opinion the scaffolding thing is too complex for beginners and
unnecessary so.  I imagine the process of creating example
applications should be as simple as filling a config file with local
info about the database, application and table name and running a
script that would create all needed files.

In my humble attempt to reach that gole I created two files (they have
unix line endings so in Windows you might need to adjust them).  I
attached them to
http://dev.catalyst.perl.org/wiki/ParametrizedExamples
 (where I copied this email text as well).

Here is a short description of them:

AppName.tgz - this is a packed working application created according
to the the scaffolding movie, I only changed the database password to
some dummy string to keep it secret, aside from that it is packed
exactly as it works on my server

createscaff.pl - this is both the config and creator

To create an example CRUD application you need to follow following procedure:
1. unpack the AppName to some directory
2. modify the createscaff.pl ($skelpath should point to the directory
where you unpacked the AppName template application, other parameters
are, I hope, commented enough)
3. run createscaff.pl - this will create a new subdir in current
directory, that subdir will contain the parametrized example
application
4. cd to the created dir
5. run the only created SQL file to create the table

And then you can:
6. run script/CreatedApp_server.pl
7. connect to localhost:3000/tablename


As you can see the createscuff script is very simple, and for sure it
can break in many corner cases, but I decided that since the whole
subject of writing programs generating programs is very complex  it is
better to start with something simple.  At this stage I want to
generate some discussion not to present a ready to go solution.

I think  my approach have another benefit - it makes the task of
creating new examples very simple.  You need a working application,
then identify places that parametrisation, create the config for them,
and pack everything.  Thats all.

Best Regards,
Zbigniew Lukasiak


More information about the Catalyst mailing list