[Rt-commit] r2551 - experiments/Bamboo/doc

autrijus at bestpractical.com autrijus at bestpractical.com
Fri Apr 1 03:53:24 EST 2005


Author: autrijus
Date: Fri Apr  1 03:53:23 2005
New Revision: 2551

Added:
   experiments/Bamboo/doc/notes
Log:
* some notes

Added: experiments/Bamboo/doc/notes
==============================================================================
--- (empty file)
+++ experiments/Bamboo/doc/notes	Fri Apr  1 03:53:23 2005
@@ -0,0 +1,140 @@
+- Web Counter
+  - On each request, we:
+   - retrieve value
+   - add it with 1
+    - ...write it back -- done implicitly to disk
+   - display the counter
+
+Model:
+ - "Counter" class (inside facade)
+ - request -> counter.html
+ - unpack the acl part (not really used)
+ - unpack the operations part (not really used, for now)
+    - add action-specific operations before and after user code
+ - trigger the renderer
+    - in Mason
+    - or TT2
+
+    - View-Facade
+     - all hash access are interpreted as read-only attribute
+     - all methods are actually view helper methods that acts on the invocant
+
+    Current count: <% $c{counter}{value} %>
+    Current count: <% $c{counter}->as_list %>
+    $v $c
+    $m $r
+
+- If we want to do RTML based on the:
+  - draw OPs
+  - action OPs
+- then we hook it as its own View Facade and have the
+  correct action emitters defined in RTML that can express
+  the rich object-based OP language we have.
+
+- Facade buys you
+  - encapsuation
+   - only registered methods can be called
+   - only registered parameters can be used
+  - introspection
+   - list of methods
+     - and their parameters
+       - not type, but validator-as-type
+  - validation
+   - arbitary code callbacks
+     - yields true or false?
+     - no transformers/canonicalizers at that level
+  - transformers --- XXX TBD
+
+- Controller intuitions 
+  - Orthogonal to the Facade Model
+  - HTTP FORM POST controls everything
+  - We may use GET just to note a particularly nondestructive
+    sequence of events, but that is not tied to the URI at all --
+    in this regard we are fundamentally SOAPish and RPCish.
+
+  - what you can pass in is not only method calls
+  - but also factory objects
+
+        0-PetStore::Product-SomeMoniker-new = 1
+        1-PetStore::Product-SomeMoniker-Load-__1 = 26
+        GET /Pets?=23
+        $foo = new Bar;
+        $foo = new Bar; $foo->Load(26);
+
+  - an imperative, sequential, assembly language complete
+    with LINE NUMBERS and GOTOs!
+
+  - assuming the line number is generated by the form compiler
+    in a sequential unique fashion:
+
+    # $object may be a class or a previously obtained moniker
+        "Class::Name-ObjectId"
+
+        "Class::Name-FooObj-new"
+        "Class::Name-FooObj-currentVal--_1" = 6
+
+    $FooObj = Class::Name->new()
+    $FooObj->currentVal( _1 => 6 )
+
+    $moniker = $object -> method ( %params )
+
+  - "new" is special; it is the only method that returns an object; in
+    other words, any other methods just return the invoker.
+
+    # arguments may be objects, but never classes
+    my $obj = Class.new(...);
+    my $rv  = $obj.method(...);
+    $obj.some_attr = 3;
+
+    my $x = $obj.some_attr;
+    push $obj.some_attr, "hello";
+    delete $obj.some_attr{"blah"};
+
+    class Counter {
+        method doSomething {
+            $.val = rand();
+        }
+    }
+
+    # $counter is loaded first
+    <input type="button"
+           onclick="sub { $counter.val = rand() }">
+           onclick="<% serialize_call($counter, "doSomething", ()) %>">
+
+    thaw {
+        frozen objects
+        - Class
+        - Attributes
+         - mandatory ones
+         - non-mandatory that we nevertheless care about
+        - HMAC_SHA'ed with a server secret
+    }
+
+    sub { ... }
+    sub { ... }
+
+- View intuitions 
+
+    - Controller-driving form
+        <form name="embed">
+            <script runAt="server">
+                $obj = Class->new(...)
+                $obj->method( ___ )
+            </script>
+        </form>
+
+    - Model-presentation form
+       -- draws objects
+       -- arranges show/hide/whatever relations
+       -- sets and maintains the "current topic" in the stash
+       -- skinnable and themable and whatever
+       -- "widget kit"
+
+
+- Your form contains a continuation in the flow chain
+    - Alternatively, since template developers are end-users,
+      your form contains a bunch of GOTO statements with conditionals
+<input type="hidden" name="0-Bamboo::-0-Meta-OnSuccessNextPage" value="product_list.html">
+
+
+


More information about the Rt-commit mailing list