Page 1 of 1

Preferred approach to building web applications with Jade

Posted: Fri Aug 07, 2009 11:21 am
by ConvertFromOldNGs
by Eric Peachey >> Sun, 3 Sep 2000 21:25:06 GMT

Hello,

What approach do you people find most successful for building serious web applications using Jade?

Do you use the plain web enabled application approach (just tick the check box) or do you use some other method for generating your pages and handling input from browsers?

It would be interesting to find out more about your experiences in this area.

Cheers,

Eric in Dunedin

Re: Preferred approach to building web applications with Jade

Posted: Fri Aug 07, 2009 11:21 am
by ConvertFromOldNGs
by WVerkley >> Tue, 5 Sep 2000 1:50:36 GMT

The standard web enabled jade application is a good aproach for internal applications, but not for proffesional looking internet web sites IMHO. The Jade GUI paradigm really isnt a good fit for building web applications, and because a Jade GUI will never really translate into a proffesional looking web page.

Our solution was to build our own Web Architecture ("obj-x") to allow Jade to process HTTP requests (i.e. a request from the browser to "GET" an HTML page). Its similar to writing CGI scripts or ASP pages, but there is support for higher level concepts such as pages, implicit session management, and applications, plus all your standard HTTP/HTML utility functions.

You can even mix your code into "ASP pages" so you can mix HTML (or some other markup language like WML) with JadeScript. This is quite nice, since you can then use a good HTML editor (i prefer Visual InterDev myself) to design and maintain your HTML pages as well as your presentation level code. Ive developed several small HTML and WAP applications using Jade in this way.

Wilfred.

Re: Preferred approach to building web applications with Jade

Posted: Fri Aug 07, 2009 11:21 am
by ConvertFromOldNGs
by Stephen Persson >> Tue, 5 Sep 2000 2:40:38 GMT

We have pretty much done the same as Wilfred, in that we also have given up on trying to create a professional web site solely using Jade, and have built our own web functionality on top of the Jade basics.

We have a graphic designer who basically constucts the sites using Dreamweaver. This lets us have javascripts, rollovers, frames, shockwave & flash movies and basically make them all look like a professional web site.

I then add comments to the raw html where I want Jade to insert its generated html.
On each control I have a method mGenerateHTML which will generate the html code for that control passed on the parameters passed back from the browser, then I read the html file, insert the control at the position I want, and send my page as the reply - instead of the Jade generated one. ( Use the sendReply method of the InternetPipe class).
Parameters can be passed back to the server, and read using the processRequest(httpString, queryString: String) method.

This probably sounds like an excessively complicated way to do things, but once the architecture is built it really is straight forward and produces far better pages with far more functionality - applets, javascripts, frames, rollovers, etc..
It is also very economical with licensing - the user doesn't hog one license the whole time they are browsing, which is sitting idle waiting for them 99% of the time anyway - we have managed to get session times down to 1/100th of a second, with a new session created for every request, then closed once the reply is send.

Check out www.byarrangement.co.nz which uses the above architecture.

Stephen