[Maypole] Maypole 3.0 brainstorming

From: Sebastian Riedel (sri at oook.de)
Date: Wed Oct 27 2004 - 15:59:38 BST


Hi,

Now that we finally finished 2.0 it's time to think about the future.
The brainstorming started today on #maypole, maybe you guys have some
good ideas too.

  - support for multiple models (we definately need this)
    
      the implementation details are still to be defined, this is just
      a first try:

      package MyApp;
      use Maypole::Application qw/YAML -Setup/;

      package MyApp::Model::MyCDBI::Beer;

      sub ping :Exported {}

      package MyApp::Model::AnotherLDAP

      sub test :Exported {}

      __DATA__
      models:
        MyCDBI:
          base: CDBI
          dsn: 'dbi:mysql:myapp'
          user: myapp
          pass: secret
        OurLDAP:
          base: LDAP
          host: lalala
          foo: bar
        AnotherLDAP:
          base: LDAP
          host: foo
        SomePlucene:
          base: Plucene
          path: '/tmp/'
      uri_base: 'http://maypole.perl.org/myapp/'
      rows_per_page: 10
      application_name: MyApp

  - support for Controller classes (like ruby on rails) (i'm unsure about this, maybe it just adds bloat)

      package MyApp;
      use Maypole::Application qw/YAML Authentication::Abstract Relationship -Setup/;
      use Maypole::Constants;

      sub authenticate {
          my $r = shift;
          $r->private;
          unless ($r->user) {
              $r->controller('authentication')
              $r->action('login');
          }
          return OK;
      }

      package MyApp::Controller::Authentication;

      sub login :Exported { }

      package MyApp::Controller::Blog;
      use MyApp::Model::MyCDBI::Blog qw/-Default/;
      use MyApp::Model::MyCDBI::Post;

      sub recent :Exported {
          my ($self, $r) = @_;
          $r->objects(MyApp::Model::MyCDBI::Post->recent_posts);
      }

  
      package MyApp::Controller::Tag;
      use MyApp::Model::MyCDBI::Tag qw/-Default/;

      package MyApp::Model::MyCDBI::Post;

      sub recent_posts {
        return MyApp::Model::MyCDBI::Post->search_where(recent=>"1");
      }

      __DATA__
      models:
        MyCDBI:
          base: CDBI
          dsn: 'dbi:mysql:myapp'
          user: myapp
          pass: secret
      controllers:
        - Authentication
        - Blog
        - Tag
      uri_base: 'http://maypole.perl.org/myapp/'
      rows_per_page: 10
      application_name: MyApp
      relationships:
        'posts have tags'

So let the brainstorming begin! :)

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