[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: Filtering and Separation of Presentation Layer
From:       Jonathan Vanasco <jon () 2xlp ! com>
Date:       2005-12-28 15:55:37
Message-ID: 13EE4681-D99F-4F08-B9A0-2E850C8867ED () 2xlp ! com
[Download RAW message or body]

On Dec 26, 2005, at 11:50 AM, Jeff wrote:
> I have been wondering recently about separation of presentation and  
> data in the context of AJAX - whilst keeping the presentation still  
> server-side. Anyone doing anything interesting in this space with  
> mod_perl?

I've been working on an AJAX heavy site thats nearing completion for  
a while now (so long, AJAX didn't exist when i started it.  i called  
it xmlhttprequest, and people said i was stupid).

i just run all of the data handling stuff from a /service/ directory  
and offer multpiple ways to access it
	?f(ormat)=json - JSON serialized objects
	?f=xml	- XML data structures
	?f=xhtml - XHTML chunks that are used to entirely replace sections  
of a page

the service modules are basically mirrors of page view modules --  
except they only return a dataobject or error codes.  since  
everything on my  project is oop, there's little actual code on the  
page generation

I tried this project in a bunch of languages before setting on  
mod_perl  - php, python, rails -- i've actually found mod_perl to be  
the easist and most straightforward way to do anything 'ajax' related.

it doesn't do the automagic js generation like some rails things do,  
but I dislike a lot of that code.

> I think a server presentation later/filter, has to be preferred to  
> complex client-side Javascript rendering engines? Javascript is a  
> PITA to code and debug, and there are too many buggy versions out  
> there.

Just use MochiKit ( http://www.mochikit.org ).  aside from plugging a  
friend's project, its f*ing amazing and REALLY simplifies and cuts  
down JS coding (and debugging with its built in error logging).

The one issue with it though, is that the whitespace stripped version  
is 70k ! - you can use a script inside the SVN trunk to make a   
custom stripped version that only has certain elements -- I just use  
Base and Async  which make up 25k , to handle all of my data fetching/ 
parsing

On Dec 26, 2005, at 1:43 PM, Joachim Zobel wrote:
> One thing I have in mind is that this way it should be easy to move
> stuff between client and server. I have a TAL implementation in
> Javascript (http://www.heute-morgen.de/test/domtal.html -  
> attention, no
> serious testing yet, no xml usage either) and I would like to put  
> Petal
> into the filtering presentation layer.

Check out all of the above in this:
	http://mochikit.org/examples/ajax_tables/index.html


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic