[Catalyst] Sending Email from Page?
bobtfish at bobtfish.net
Sun Mar 27 17:22:23 GMT 2011
On 27 Mar 2011, at 16:30, John M. Dlugosz wrote:
> "The model manages the behavior and data of the application domain,
> responds to requests for information about its state (usually from
> the view), and responds to instructions to change state (usually
> from the controller)."
And I would say that sending an email is a state change, and behavior
of the application domain here.
> An arbitrary helper subroutine used by the Controller is not a
> Model. Since it is side-effect only, it matches one of the links in
> the graph (Controller TO Model) so it "fits" in the architecture
> provides the proper connectivity. But that is a kludge, not its
> proper usage.
Again, I think that the sending of email from the application is _very
much_ behavior. In future you may want to replace the implementation
of it, or wrap it with extra functionality (e.g. to count the number
of emails sent), or reuse it in an application context beyond the web
app (e.g. sending email from a batch script).
With a model all of these things are not only possible, they're easy,
and you've got a framework for the abstraction and use outside
Catalyst already provided...
More information about the Catalyst