Skip to content

Comment on MVC, PVC and (¬M)VC

Comments

I had to read this in a bit of a hurry (on my way out the door) but I would've liked to see an abstract up front in the essay (essentially the last paragraph first).

Also, for doing a JS based SPI, what's the preferred solution for a RESTful domain logic server? Is there a framework out there that simply doesn't contain the concept of a view/template?

Sinatra?

But before implementing a 100% pure, view-free server, consider that delivering an HTML view for each resource can be handy for testing and administrative tasks. It's the exact same information one might get from JSON or XML or YAML, but it's still nice sometimes to be able to fire upa standard browser window and do stuff on the server directly.

I think view-free is a bit of a misnomer. Even in sinatra, you could consider JSON as a "view". You can still test that too with browser plugins like "REST client" for firefox or htty on the command-line.

What it forces you do to is make sure your API is very clean, very succinct and exposes all critical portions of the backend.

Really all we're talking about is the model being a REST service instead of a database model.

"Is there a framework out there that simply doesn't contain the concept of a view/template?"

Rack. Though as features are dropped, the idea of something being "a framework" gets increasingly market-y.

There's a handful. In Java, you could use http://www.restlet.org/ or http://jboss.org/resteasy ; alternatively, you can use a framework that does have templates but makes it easy to return a serializable object directly from the controller, like http://playframework.org or http://vraptor.caelum.com.br/en/

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.