--- trunk/lib/Frey/Manual.pod 2008/12/03 19:00:10 701 +++ trunk/lib/Frey/Manual.pod 2008/12/06 00:20:20 729 @@ -2,6 +2,119 @@ This page describes how to use and develop with L +=head1 Designing user interaction flows + +Frey is all about creating Moose classes as your interaction with pages. +Each page is instance of class with some parametars received with post or +get request. + +If you want to access those parameters in your object, you have to define +attributes for it using L + +You can also generate result in three different forms: + + +=over 20 + +=item as_markup + +HTML content + +=item as_sponge + +Tabular output + +FIXME link to description + +=item as_data + +Any perl hash structure + +=back + + +=head2 No html templates + +Frey doesn't have html templates. Since your methods are part of REST URIs, +it doesn't make sense to separate html from object itself, which represent +web page. L provides role which has a bunch of helpful things +when creating html. + +Basically, if html you are generating in readable code semantically correct +to you, it the right track. + +You don't even have to create initial entry form as L, +which will start your L classes, will call L +for help and generate initial form for you. + +Creating files is mess, so L will +create class and test skeleton for you. + +If I did it right, it should read similar to human language, like SmallTalk. + +To make things simple, there are few convertions (with nod to Ruby on Rails) +which will help you get started: + + +=head2 default parametars + +Default values for + + +=head2 html markup + +HTML markup should be enclosed in C< qq| > and C< | > quotes. There is also +funny but very readable convention of multi line html when you have to +intermix confitions: + + my $html + = qq|

First

| + . ( $is_second ? qq|

Second

| : '' ) + . qq|

Third

| + ; + +This will be checked and reported at some point. Ideally, I would like to +write just + + my $html + = qq|

First

| + . $is_second ? qq|

Second

| : '' + . qq|

Third

| + ; + +which is valid perl syntax but doesn't work as expected. + + +=head2 SmallTalk like refactoring + +Frey is heavily influcenced by SmallTalks, up to the point of syntax. Coding +Frey code should be like playing with L. And you might end up with +result which might surprise you. + +Refactoring tools are not new in perl. However, + + +=head2 examples + +To help you get started, here are few implemented flows in Frey: + +=over 20 + +=item L + +Simple interaction with C + +=item L + +Gather data, display selection form with checkboxes + +=item L + +Display a huge amount of icons with single HTTP request + +=back + + =head1 Command-line integration One of key points is that L runs under your user. This means it has @@ -53,6 +166,10 @@ Helper using C to quickly grep, select result and jump to C +=head2 bin/log.sh + +Open last 3 logs in vim + =head2 bin/checkout-js.sh Checkout bunch of JavaScript code from all over the net, some of which is