[web-devel] Chris Done on a new pure Haskell pgsql binding and MVC

Greg Weber greg at gregweber.info
Fri Jun 10 16:12:47 CEST 2011


I am all for increasing the M in the MVC of Yesod. In a simple REST app
where resources closely map to the data modeling, this can be less of an
issue. Basically you need the M once you would have duplicate model code
between any 2 requests. Chris is advocating a fairly strict separation. I
think it can still be simpler to put a read query in a controller. Once that
query (or a part of it) is needed elsewhere it should definitely be named
and reused. Updates do need to maintain invariants and thus should generally
stay out of the controller. I would like to come up with a good system for
maintaining invariants and propagating violations to forms, and other useful
systems for doing more than just taking the query out of the controller.

Let us know if there is anything stopping you from separating out code into
a Models directory right now.

Greg Weber

On Fri, Jun 10, 2011 at 4:00 AM, Aur Saraf <sonoflilit at gmail.com> wrote:

> None of us should miss this. It especially raised a few questions in
> my head about the architecture of my site.
>
> http://chrisdone.com/posts/2011-06-05-postgres-hpaste-edsls.html
>
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/web-devel/attachments/20110610/7708e0f1/attachment.htm>


More information about the web-devel mailing list