Over a million developers have joined DZone.

Jaggery.js: The Delicious Javascript Framework

· Java Zone

Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code! Brought to you in partnership with ZeroTurnaround.

Why JavaScript ?

There is no denying that since its inception in the mid 90’s, JavaScript has become one of the most popular Web development languages. So it has become the top language due to its ability to deliver rich, dynamic web content, its relatively lightweight and its high ease of use. In recent years, we’ve seen its continued evolution beyond the desktop to areas such as mobility and server-side web applications. There are strong odds in favor of JavaScript becoming the dominant language of the enterprise. This isn’t to say every other language will atrophy overnight, (They won’t!) but legacy systems count on them for sure. So yet a revolutionary, a simple, open language, equally adapted to building both client and server-side apps? There’s no such thing as technology perfection, but JavaScript looks like the next best thing.

A modern web application invariably includes a significant client-side Javascript component. Why then are we using a completely separate language for server-side programming? You don’t have to switch our brain here and there, now we can use Javascript for server-side-programming! For an example, Node.js which is based on Google’s V8 JavaScript engine, works wonders. I’m directing this post towards another revolutionary server-side Javascript framework called "jaggery.js". Jaggery uses Javascript as the server-side programming language, the obvious choice for simplification. Let’s get on with it, shall we ?

Jaggeryjs

Jaggery is a framework to write web apps and HTTP-focused web services for all aspects of the application: front-end, communication, server-side logic and persistence in pure Javascript. One of the intents of this framework is to reduce the gap between writing web apps and web services. Importantly, Jaggery is open-source and released under Apache 2.0. if you interested to read the full manifesto read it from here .

Enough said, here’s a simple example, a step beyond the basic hello world to help you get a sample of Jaggery’s core implementations. Enjoy. :)

<%
var jsonString = '{"name":"Pubudu","company":"WSO2"}';
print(parse(jsonString));
%>

You can try the above code on Jaggery-Tryit . Download jaggery framework form the parent site and do your experiments, here are a few sample implementations which helps you to learn in depth about what jaggery can do.

Cheers, Happy Coding.

Resources

[1]http://wso2.com/library/articles/2012/10/introducing-jaggery-the-newer-easier-way-of-writing-web-apps/ 

[2] http://jaggeryjs.org/

[3] http://wso2.com/library/webinars/2012/05/wso2-product-release-webinar-introducing-jaggery-serverside-javascript-framework-composing-web-app/

The Java Zone is brought to you in partnership with ZeroTurnaround. Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code!

Topics:

Published at DZone with permission of Pubudu Dissanayake. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}