PURE is the View, who has the Model and Controller?

7 views
Skip to first unread message

AJ ONeal

unread,
Feb 11, 2010, 11:56:53 AM2/11/10
to pure-unobtrusive-rendering-engine
I've been looking around for the best js tools I can find and I've stumbled upon a few frameworks that may serve for valuable usage (and great food for thought in any case).



Sammy JS - Routes / Controller

jQuery BBQ - Routes / Controller

Kiwi - Model

AJ ONeal

Mic (BeeBole)

unread,
Feb 12, 2010, 3:31:35 PM2/12/10
to JavaScript Templates Engine PURE
Hi Alvin,

I'm not a fan of MVC frameworks. It's like a well intentioned mother
that hugs you too much :)
Ideas are not free to flow. Sooner or later, you strip them to fit the
mold.

But, you fired my curiosity +-) How to start this?
What would be the pieces in simple terms ?

Here's my take (heavily influenced from our current project, and my
relative ignorance of what an MVC really is):

Model:
- - - - -
A JSON tree in the browser representing the data of the app.
A storage I/O (HTML5 local storage when offline, JSON calls to a
backend for persistance)

Controller:
- - - - - - - -
Logic to read from and write to the JSON tree and the HTML view.
2 properties of JS help this:
- object are passed by reference, all functions in the app reference
the same tree
- and JS is mono-thread, no conflicts in writing or getting non
updated data

An eventing mechanism that fires either when the user/a timer makes
something or when the data come back from the server.

View:
- - - - -
Mix a subset of the JSON tree with HTML templates to generate HTML (I
understand we agree on what is here :)

Is that a good start for you?
Feel free to change everything :)
Your turn!

On Feb 11, 5:56 pm, AJ ONeal <Alvin.ON...@gmail.com> wrote:
> I've been looking around for the best js tools I can find and I've stumbled
> upon a few frameworks that may serve for valuable usage (and great food for
> thought in any case).
>

> http://blog.new-bamboo.co.uk/2009/11/10/thoughts-on-kiwi-js-in-relati...
>
> Sammy JS - Routes / Controllerhttp://code.quirkey.com/sammy/

Nick Ricketts

unread,
Feb 12, 2010, 3:47:23 PM2/12/10
to pure-unobtrusive...@googlegroups.com
There is also JavaScript mvc if you really want it. http://javascriptmvc.com/#&who=getstarted

I like pure a lot. It is the best templating library I used. I use it
on lots of my projects because it helps keep things simple and clean.

> --
> You received this message because you are subscribed to the Google
> Groups "JavaScript Templates Engine PURE" group.
> To post to this group, send email to Pure-Unobtrusive...@googlegroups.com
> .
> To unsubscribe from this group, send email to Pure-Unobtrusive-Rende...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/Pure-Unobtrusive-Rendering-Engine?hl=en
> .
>

AJ ONeal

unread,
Feb 13, 2010, 7:23:28 PM2/13/10
to pure-unobtrusive...@googlegroups.com
I'm not a fan of MVC frameworks. It's like a well intentioned mother
that hugs you too much :)
Ideas are not free to flow. Sooner or later, you strip them to fit the
mold.

Some people get the Model, View, Controller thing down, but most often end up mixing stuff up somewhere along the line and not abstracting, which is where the well-intentioned mother becomes an annoyance.


MVC is a buzzword I like to throw around. What I really mean is the idea behind MVC; separation and abstraction.

If you simplify MVC down to just these components, I don't think it's a very good model.
Model - JSON / SQL / CSV
View - HTML + CSS / PDF / PNG
Controller - Erlang / JavaScript / DOM

I think it's more that each Atom of a program should have it's own MVC.


To me design patterns are about discovering the natural separations of Data and Messages - like Bach discovered Counterpoint and Newton discovered Calculus. Like the art of Judo, it's about learning how work with the universe rather than against it.



We discussed this earlier:


I'm still trying to understand the most natural separation, but including the research that I've done recently, this is my discovery thus far:


Persistent Storage / Data Store : SQLite, CouchDB, Fixtures

Persistence Abstraction Layer (Mapper) : ActiveModel + ActiveRecord, DataMapper, SQLAlchemy, Doctrine
Ideally, this would work across languages such that if part of my app is in Python and I update the Store, the Ruby and Erlang models would receive an update message as well.
Pushes updates to the storage, then notifies the model

Model : Class which inherits from one or more Persistence Abstraction - Erlang, Ruby, Python
Pushes updates to the controller

Controller : Responds to the intentions of messages, checks integrity of the message, pushes updates to model and presenter, sends additional message to presenter indicating the success or error once the model confirms the message.

Message / Event Abstraction : ??? Something that informs the controller of events / messages

Presenter / Receiver (Abstraction) : Pushes updates to the template and design.
(?) Also reads the view, or maybe the view 

Template: static template which gives structure to controls and view elements - HTML

Design View : design - CSS, PNG

Message View : DOM, jQuery

Events : JavaScript/DOM

Experience: The template adapted with the design, events, and binding. This is a stateful collection of components that comes alive in the face of the user.
Sends messages (events) to the presenter / receiver.

AJ ONeal

unread,
Feb 13, 2010, 7:26:51 PM2/13/10
to pure-unobtrusive...@googlegroups.com
There is also JavaScript mvc if you really want it. http://javascriptmvc.com/#&who=getstarted 
I like pure a lot. It is the best templating library I used. I use it on lots of my projects because it helps keep things simple and clean.

I agree, PURE is the best template engine. The thing I like most is that it allows one to create meaningful templates that a designer can manipulate instead of having a template language.

I watched the video for JavaScriptMVC 2.0 as well as a few screencasts for SproutCore, which also looks promising.

I'm not sure that either of those are quite what I'm looking for. They definitely have some great ideas, but it looks like some of the logic may be too tightly coupled to their own system.

AJ ONeal

AJ ONeal

unread,
Feb 13, 2010, 7:31:20 PM2/13/10
to pure-unobtrusive...@googlegroups.com
Message / Event Abstraction : ??? Something that informs the controller of events / messages


Perhaps Routing + Data Transport would be a good example of this.
Sammy + JSON 
Rails + HTTP Forms

AJ ONeal

Simon Oberhammer

unread,
Feb 16, 2010, 8:31:26 AM2/16/10
to JavaScript Templates Engine PURE
not MVC related, but:

i'm actually using pureskin in combination with helmang [1] which is
nice since i get to write javascript all the way down :)

[1] http://github.com/hns/helma-ng

Reply all
Reply to author
Forward
0 new messages