ASP pages in Jade

Discussions about design and architecture principles, including native JADE systems and JADE interoperating with other technologies
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

ASP pages in Jade

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:21 am

by Wilfred Verkley >> Thu, 8 Jun 2000 4:28:22 GMT

I had a quick play around with an Idea ive been thinking of for a while but never got started, a Jade Version of "Active Server Pages".

It was suprisingly easy actually. Because i already had the architecture in place (we built our own web architecture here at Wang), all i needed to add was a pre-processor step that converted an ASP page written in JadeScript & HTML into a pure JadeScript source, which then gets compiled and executed on the fly using the JadeCompiler object.

Anyone thats done ASP, PHP3, or similar will be familiar with this example :
<%@ Language=JadeScript>
<%
vars
employee : Employee;begin

%>
<HTML>
<TITLE>Employees</TITLE>
<BODY>
<H3>Employees</H3>

<TABLE>
<TR><TD><B>Name</B></TD></TR>
<%
foreach employee in mySession.currentEmployer.allMyEmployees do
%>
<TR><TD><%=employee.name%></TD></TR>
<%
endforeach;
%>
</TABLE>

</BODY>
</HTML>
<%
end;
%>

Its an immensely cool way to write web applications since the integration between the HTML (presentation layer), the business logic, and the data is so clean (mostly thanks to Jade), and yet you can use the full power of Jade and all the features on the web browser to write your applications. Additionally, you can fully use tools like MS Visual Interdev or FrontPage to design and maintain all your web pages.

On the downside, executing JadeScript on the fly is relatively slow. Where perfomance is an issue, you would still code your web applications in pure jade. However you could prototype your application using these ASP-like pages, and once the design is stable, port the "compiled jade-script" produced by the ASP pre-processor into pure jade code.

Wilfred.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: ASP pages in Jade

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:21 am

by Philip Q >> Sat, 2 Dec 2000 6:09:54 GMT

That might be a good idea, but there would need to be alot of server extensions (on the server) to get it to work, it would be like extracting a JADE schema to the web really, it would be harder to manage (on my point, being a developer in ASP, using vbscript and jscript (javascript really)). If i was using a databse to eaisily track down users and stuff, i would much rather use Access or SQL Server than having to build a JADE app to get the data out in a way that i want it.

"Wilfred Verkley" <wxv@wang.co.nz> wrote in message news:5h4vlHQ0$GA.276@news.jadeworld.com...

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: ASP pages in Jade

Postby ConvertFromOldNGs » Fri Aug 07, 2009 11:21 am

by Wilfred Verkley >> Sun, 17 Dec 2000 20:46:17 GMT
That might be a good idea, but there would need to be alot of server extensions (on the server) to get it to work, it would be like extracting a JADE schema to the web really

I have got it to work completely. Ive built several small applications writting all the user interface code (HTML / WML) in JadeScript ASP files. It isnt that complicated.

The main disadvantages with this technique is the limitations of Jade/JadeScript itself. The script you are executing is basically a single jade method. You cant have nested methods, and the only way to have "includes" is to execute another nested page.

For writing small web applications I dont think you can beat VBScript/SQL Server based ASP pages. However, if you already have a Jade database that you need to make available over the web, i think this is a good way to go about it. You can quickly build and edit proffesional HTML with tools like DreamWeaver or InterDev and maintain your JadeScript inside those tools. Far better then hand-coding your HTML from within Jade :-)

Wilfred.


Return to “Design and Architecture”

Who is online

Users browsing this forum: No registered users and 16 guests

cron