15. Endless adaptors. Like the many Catalyst views or models. Why not use TT directly? Or Email::Send?
16. 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?
17. WebNano – main ideas Use of Bread::Board Controllers in Request Scope
18. 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
19. Catalyst controllers: sub index :Path :Args(0) { my ( $self, $c ) = @_; # Hello World $c->response->body( $c->welcome_message ); }
20. $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
21.
22. The answers never satisfied me. They looked like based on some incidental design choice, nothing that could not be changed.
23. Until I read series of blog posts, starting with nothingmuch articles on: Immutable Data Structures
24. I like it - it simplifies a lot of things when used moderately.
25. But it also means that a Catalyst controller cannot contain data about the request.
28. From the many Perl MVC web frameworks only Tatsumaki uses request scope controllers. Rails and Django do.
29. 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).
30. 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.
31. Like with other variables: Create objects in the narrowest scope that needs them.