Make the generated action method fit better into what the StompTestApp::Controller...
authort0m <bobtfish@bobtfish.net>
Thu, 28 May 2009 00:28:24 +0000 (01:28 +0100)
committert0m <bobtfish@bobtfish.net>
Thu, 28 May 2009 00:30:03 +0000 (01:30 +0100)
commitd7bd7765d3976d6d146c0e1b0808152319e6b98e
treeea11fea0fa6dff032c7a862da56bfddfa5488abe
parent932a7c336e8cbfe5f07261dca90b78833c467ccf
Make the generated action method fit better into what the StompTestApp::Controller::TestController does, viz getting stuff out of ->req->data, and returning ->stash->{response} - this is the correct basic protocol yes?

Also add a type check to the input document (i.e. the deserialized message) using structured and lexical
type constraints. I do this in a method modifier, to illustrate that we can get the reflector
(or something) to apply a modifier like this around every model method.

Tada, instant explosion when the data incoming is bad.

You can do this in the controller action with the response document before you stash it also.

This isn't quite as elegant as applying the types as part of the interface role, but I'm sure we
can work through that if this is considered useful.
Makefile.PL
lib/CatalystX/DynamicComponent/ModelToControllerReflector.pm
t/lib/SomeModelClass.pm