Model/View separation in ESME

3 views
Skip to first unread message

Darren Hague

unread,
Dec 5, 2008, 12:08:27 PM12/5/08
to esme...@googlegroups.com
A suggestion for model-view separation: I think that Comet render() methods should return JSON, which can be rendered to HTML by the client. The client HTML should contain a template, eg.

<table class="messages">
<!-- This is the template for a single message -->
<tr id="esme.message" style="visibility:hidden">
<td id="esme.message.body">This is a test message</td>
<td id="esme.message.tags">tag1, tag2</td>
<td id="esme.message.from">dhague</td>
</tr>
<!-- end template -->
</table>

The client side event handler which reacts to the comet.render() would then just parse the JSON, insert it into a copy of the template, and then add that copy below the template itself in the DOM, with visibility set to "visible".

This approach keeps all of the Comet-related markup in the client HTML, and a designer needs only to toggle style="visibility:hidden" to style="visibility:visible" to see how a message would look.

Cheers,
Darren


--
darren...@fortybeans.com

David Pollak

unread,
Dec 5, 2008, 7:58:15 PM12/5/08
to esme...@googlegroups.com
Will do
--
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

Hirsch, Richard

unread,
Dec 5, 2008, 11:51:58 PM12/5/08
to esme...@googlegroups.com
This would also help for those wishing to creating their own corporate skins

By the way, when do we want to shift these conversations to the apache esme-dev mailing list. It is already up and running.

________________________________
winmail.dat

David Pollak

unread,
Dec 6, 2008, 9:26:08 AM12/6/08
to esme...@googlegroups.com
Now... also we should announce/invite people to the new mailing list.

Hirsch, Richard

unread,
Dec 6, 2008, 12:56:45 PM12/6/08
to esme...@googlegroups.com
Now pushing the apache mailing list internally as well

________________________________
Lift, the simply functional web framework http://liftweb.net <http://liftweb.net/>
Collaborative Task Management http://much4.us <http://much4.us/>
winmail.dat

Hirsch, Richard

unread,
Dec 6, 2008, 1:03:21 PM12/6/08
to esme...@googlegroups.com, esme...@incubator.apache.org
Just in case, you didn't notice it. We got a technical comment about our REST-API http://code.google.com/p/esmeproject/wiki/REST_API_Documantation (look at the bottom)

________________________________

From: esme...@googlegroups.com on behalf of David Pollak
Sent: Sat 12/6/2008 15:26
To: esme...@googlegroups.com
Subject: [ESME-dev] Re: Model/View separation in ESME


Lift, the simply functional web framework http://liftweb.net <http://liftweb.net/>
Collaborative Task Management http://much4.us <http://much4.us/>
winmail.dat
Reply all
Reply to author
Forward
0 new messages