The buzz is MVC

33 views
Skip to first unread message

kstubs

unread,
Nov 26, 2012, 11:48:19 AM11/26/12
to prototype-s...@googlegroups.com
I'd be interested in anyone's efforts towards an MVC framework with prototype.js as the inherit backend.  So, agilityjs (http://agilityjs.com/) to JQuery, as an example.
This is a fresh topic, but related to my other topics, "domo', and "angular".  If nobody is doing this, I'd be surprised.  

Thanks,
Karl..

Victor

unread,
Dec 30, 2012, 5:32:43 PM12/30/12
to prototype-s...@googlegroups.com
Nobody answered... so I'll try to explain my point of view. In short words: I don't need full JavaScript MVC framework.

I am working on Java web applications (J2EE or Spring based, running on JBoss or Tomcat respectively). There are already MVC stacks on server side (Struts + JSP, JSF + XHTML, Wicket + HTML, Spring MVC etc.) - they have Java objects for Model, another Java objects for Controller, and HTML-based markup files for View which is rendered into HTML and returned to client. Another (pure JavaScript) MVC framework on client side is redundant - rendering of Model into View (HTML) is perfectly done on server.

Client needs Controller (to work with UI widgets) and part of Model (object identifiers etc.). Controller sends AJAX requests with needed parameters to the server, and server returns rendered HTML, which can be inserted into DOM, and optionally script with Model changes.

No Model to View rendering is done on the client side, all View templates are stored in HTML-based text files (JSP, HTML).

This way gives possibility to describe few basic AJAX workflow templates and implement them in single place using event delegation and single global observer (http://javascripts.svn.sourceforge.net/viewvc/javascripts/javascripts/js.ui/js/ui/behavior.ajaxify.js?revision=303&view=markup):

1. User clicks on a link. AJAX request is sent to the server. Result is inserted into desired container. (AJAX tabs, product descriptions, gallery next/prev links etc.)
2. User clicks on a link. AJAX request is sent to the server. Result is shown in modal box (lightbox, full-sized images, dialogs).
3. User submits form. Submission is intercepted, form data is sent via AJAX. Result is inserted into desired container (votes, comments, etc.)

Reply all
Reply to author
Forward
0 new messages