NYCPHP Meetup

NYPHP.org

[nycphp-talk] JSON and MVC

Chris Snyder chsnyder at gmail.com
Wed Jul 15 12:06:03 EDT 2009


On Wed, Jul 15, 2009 at 11:59 AM, Hans Zaunere<lists at zaunere.com> wrote:

> So I think I see what you're saying.  Keep all markup (aside from perhaps the initial request) off the server.
>
> I thought about this, and played around with it a bit.  There are a couple of problems, or at least contradictions...
>
> -- everyone I talk to says do as much as you can on the server
>
> -- and with good reason, since complex JS is just a hack after another
>
> -- if I do only receive raw "bare-metal" data points via JSON from the server, it seems that the JS complexity gets astronomic, which has obvious problems and frankly greatly reduces overall application agility in my opinion (ie, markup structure, visual appearance, and application logic are once again lumped together).
>

It's just another type of file. You can have the front-end request the
template, and then the data if you like. You could even send the
template with the data, although that seems icky to me.

Point is, there's as little reason to mix your template js with your
logic js or framework as there is to mix template php with action php.
But yes, your application has expanded. You now have one model, but
two view/controller sets.


> Seems as though it's 2003 again...
>

Yes, but with closures. :-)



More information about the talk mailing list