Hi All,
After my talk at the local Perl Mongers on Wednesday, I spoke to
Barbie about handling multiple actions in a single request.
Currently this is handled by request.component which is now core
Maypole rather than a plugin, but that seems a bit like using a
sledgehammer to crack a nut for many jobs.
This bought me back to thinking about the objects array - I think it
could be clearer and easier.
Firstly, there are many cases where you only have one object and
treating request.objects as an array makes templates and code less
clear and more work. For this situation I want to provide $r->object()
which will get set the first/only object in $r->objects.
Secondly I'd like to provide named objects, but in a backward
compatible manner..
$r->objects will return all the objects in the default group
$r->objects($obj1,$obj2) will put $obj1 and $obj2 into the default group
$r->objects(foo => [$obj1, $obj2]) will put $obj1 and $obj2 into the
'foo' group
$r->objects('foo') will return the objects in the foo group
$r->objects(foo => [$obj1, $obj2], bar => [$obj1]) will put $obj1 and
$obj2 into the foo group, and $obj1 in the bar group.
$r->objects('foo','bar') will return the objects in the foo and bar
groups in that order
To ensure clarity and avoid confusion the following will be errors :
$r->objects('foo', $obj1, 'bar');
$r->objects('foo' => [$obj1], 'bar');
$r->objects(foo=>[$obj],$obj2);
$r->objects([$obj1,$obj2]);
Any thoughts, suggestions and feedback appreciated
Cheers,
A.
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Maypole-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-devel