• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
WebNano - Ideas for Web Frameworks
 

WebNano - Ideas for Web Frameworks

on

  • 943 views

My London.pm tech meeting talk (18.03.2010).

My London.pm tech meeting talk (18.03.2010).

Statistics

Views

Total Views
943
Views on SlideShare
939
Embed Views
4

Actions

Likes
1
Downloads
1
Comments
0

1 Embed 4

http://www.slideshare.net 4

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    WebNano - Ideas for Web Frameworks WebNano - Ideas for Web Frameworks Presentation Transcript

    • WebNano
      • Zbigniew Lukasiak (zby)
      Ideas for web libraries and frameworks
    • Richard P. Gabriel "Worse is Better"
    • Nickieben Bourbaki "Worse Is Better Is Worse"
    • Nickieben Bourbaki a pen name of Richard Gabriel
    • Frameworks are framing, libraries are liberating WebNano
    • Frameworks tend to tie many functions together.
    • Coupling
    • Dave Rolsky ”Want Good Tools? Break Your Problems Down”
    • Current frameworks not only deal with the web part of the task – but also create all the objects of the application.
    • Bread::Board – specialized tool Dependency Injection Pattern
    • My experiences (see WebNano tests): It works. But there are no good examples. Lacks integration with standard text config files.
    • Needs to be at least as good as current solutions.
    • Catalyst config files: View::TT: WRAPPER: 'wrapper.tt' Configuration for each component. Plus logic for loading global and local configs.
    • And maybe we could also get rid of
    • Endless adaptors. Like the many Catalyst views or models. Why not use TT directly? Or Email::Send?
    • Adaptors add another layer where things can go wrong. They don't add new functionality. They are needed to fit outside libs into the framework. But why we need to squize them there?
    • WebNano – main ideas Use of Bread::Board Controllers in Request Scope
    • Object Oriented Programming (wikipedia): each instance of which ("objects") contains all the information needed to manipulate its own data structure ("members") My extension: object should contain all data most accessed by it's methods
    • Catalyst controllers: sub index :Path :Args(0) { my ( $self, $c ) = @_; # Hello World $c->response->body( $c->welcome_message ); }
    • $c is passed to all methods as an argument, because it is always needed In contrast $self is nearly never used in all examples from Catalyst::Tutorial
    •  
    • The answers never satisfied me. They looked like based on some incidental design choice, nothing that could not be changed.
    • Until I read series of blog posts, starting with nothingmuch articles on: Immutable Data Structures
    • I like it - it simplifies a lot of things when used moderately.
    • But it also means that a Catalyst controller cannot contain data about the request.
    • This is a fundamental limitation.
    • Controllers in Request Scope
    • From the many Perl MVC web frameworks only Tatsumaki uses request scope controllers. Rails and Django do.
    • Counter argument – what if you have something heavy that you need to use in the controller? No problem the controller can access objects from outer (application scope).
    • A simple rule of thumb for immutable objects: Objects from narrower scope can contain references to objects in outer scopes, but not the other way around.
    • Like with other variables: Create objects in the narrowest scope that needs them.
    • And hopefully get rid of Stash.
    • There are more ideas in Nano
    • Questions?
    • Links
      • http://en.wikipedia.org/wiki/Worse_is_better
      • http://perlalchemy.blogspot.com/2010/02/frameworks-are-framing-libraries-are.html
      • http://github.com/zby/WebNano
      • http://blog.urth.org/2009/11/want-good-tools-break-your-problems-down.html
      • http://search.cpan.org/~stevan/Bread-Board-0.10/lib/Bread/Board.pm
      • http://blog.woobling.org/2009/05/immutable-data-structures.html
      • http://github.com/miyagawa/Tatsumaki