Re: [Maypole] Wish-list

From: Sebastian Riedel (sri at oook.de)
Date: Sun Sep 26 2004 - 15:36:37 BST


n.a:
> Hi all list members,
>
> I'm very new to the maypole.
> This weekend, I played with the Maypole Beer DB.
> Nice! Great! Interesting!
>
> >> Sebastian Riedel sri at oook.de
> >> Sat, 04 Sep 2004 21:36:56 +0200
>
> >> Todo:
> >> * fix all open bugs (pager and search results, pager and list order...more?)
> >> * put POST and GET data in $r->{params} and deprecate $r->query
> >> * call additional_data() and authenticate() for plain templates
> >> * make the templates valid XHTML
> >> * better documentation and more complex examples
> >>
> >> Patches are very welcome!
>
> Here are my humble wish lists:
>
> * Good way to make 'Exported' subs.
> I tried to add a "top_five :Exported" sub to 'BeerDB::Beer'
> according to 'The Beer Database Revisited' section.
> To do this, I must select one of two tricks
> Trick 1:
> Explicitly load 'Maypole::Model::Base' to accomplish compile time
> access to attribute-handling 'MODIFY_CODE_ATTRIBUTES'
>
> Trick 2:
> Access '%remember' directly.
>
> package BeerDB::Beer;
> $Maypole::Model::Base::remember{\&top_five}='Exported';
> sub top_five { # delete ':Exported'
> ...
>
>
> Discussion
> First trick is not so bad, however I'm not sure this doesn't cause unexpected
> side-effect. Second trick is just ugly.
> Moreover, as manual goes, attribute features are still experimental,
> Therefore it seems not good for end user to use these for now.
>
> Possible alternative is to define 'Export' class-method in
> 'Maypole::Model::Base' and say something like
>
> package BeerDB::Beer;
> SUPER->Export(\&top_five); # I'm not sure the syntax at here
> sub top_five {
> ....
>
You are doing something wrong here...
Model Class Modules should be as easy as this (note that i'm using the
svn version):

# BeerDB.pm
package BeerDB;

use base qw(Maypole::Application Maypole::Loader);

BeerDB->setup(lalala...);
BeerDB->load_model_classes;

lalala...

# BeerDB/Beer.pm
package BeerDB::Beer;

sub top_five : Exported {
    lalala...
}

lalala...
>
> * More code-saving option.
>
> >> The Beer Database Tutorial
>
> >> And that's all the programming that we need to do for our beer
> database - roughly twenty lines of Perl code.
>
> Yes, but less lines option please. For example, four-lines:
>
> package BeerDB;
> use base 'Apache::MVC::MORESIMPLE';
> BeerDB->setup("dbi:SQLite:t/beerdb.db");
> 1;
>
> All the configurations
> such as
> uri_base
> template_root
> rows_per_page
> 'has_a' and 'has_many' relations
> untaint_columns
> display_tables
> display_columns (for each table)
> column_names (for each table)
> should be stored in 'beerdb.db' itself or other external configuration
> file(YML?).
>
> It is also exciting to have a Web-based GUI configuration feature for these
> parameters!

See Maypole::Config::YAML

>
>
>
>
> Buy the way, for the win32-things,
> >> Simon Cozens simon at simon-cozens.org
> >> Sat, 25 Sep 2004 17:42:24 +0100
>
> >> Here are some notes I made while getting Maypole up on Win32:
>
> >> And then tests pass. Wee!
>
> I also have succeeded to install Maypole on my Apache1/Activeperl/XP-box.
> However when I installed two maypole applications (or sub-classes ?),
> the behavior is dubious.
> When I try to make a list view of second application, error occurs.
> It seems some-cache mechanize goes wrong.(cache of IE, Apache1, mod-perl,
> Class::DBI or Maypole).
> This does not occur in a Linux-box.
>
> I'm not deeply investigate this yet. Therefore, this is not a bug report
> but just an information for now.
>

Please file bugs against the svn version...

You can grab bleeding edge versions of everything (and some unreleased
helper modules) from http://oook.de

sebastian

_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:56 GMT