Hi Alexey,

MVC as an architectural style is very common in functional programming, but 
it manifests itself differently as a software pattern.

Separating the data from functions that process and shape it, and functions 
that polish and present it is always a good idea.  This is the core concept 
behind MVC.
Complecting the presentation of data with a two-way data binding is: 1.) a 
violation of the architectural style but, 2.) very commonly used to manage 
stateful complexities within a browser-based application.

One strategy is to apply dataflow techniques (which compose nicely and lend 
themselves to functional programming).  In this strategy, input/data is 
taken and passed down a pipeline of functions that manipulate and shape the 
data and potentially update pieces of the system (including the view) along 
the way.
To store off some chunk of the browser's current state you can use 
LocalStorage, infer it from DOM directly, or use an atom.  Using an atom is 
the most popular (the DOM is slow, everyone is used to using atoms in 
Clojure).
A common concrete implementation of this idea is browser-based PubSub.

Also note that a well-engineered web application is almost always 
functional:  It takes a requests, models it as a piece of data (most likely 
a hashmap), performs some actions building up response data and returns a 
presentation of that response.  There's nothing stopping you from 
organizing your namespaces and files in an architecturally evident way (MVC 
or otherwise).

For a much longer discussion about the observer pattern and reactive 
ClojureScript in general, please see this thread: 
https://groups.google.com/forum/#!topic/clojure-dev/LzVu4dIvOrg

If you're only in Clojure, you might want to take a look at Aleph: 
https://github.com/ztellman/aleph

I hope this helps,
Paul


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to