Second Thoughts about Software, Technology and Business...

Wednesday, March 19, 2008

Dojo Framework

I am going here to present briefly what is Dojo Framework and what you can actually do with it when it comes to professional Web Development. According to Dojo's Web Site:

"Dojo is an Open Source DHTML toolkit written in JavaScript. It builds on several contributed code bases (nWidgets, Burstlib, f(m)), which is why we refer to it sometimes as a "unified" toolkit. Dojo aims to solve some long-standing historical problems with DHTML which prevented mass adoption of dynamic web application development.

Dojo allows you to easily build dynamic capabilities into web pages and any other environment that supports JavaScript sanely. You can use the components that Dojo provides to make your web sites more usable, responsive, and functional. With Dojo you can build degradable user interfaces more easily, prototype interactive widgets quickly, and animate transitions. You can use the lower-level APIs and compatibility layers from Dojo to write portable JavaScript and simplify complex scripts. Dojo's event system, I/O APIs, and generic language enhancement form the basis of a powerful programming environment. You can use the Dojo build tools to write command-line unit-tests for your JavaScript code. The Dojo build process helps you optimize your JavaScript for deployment by grouping sets of files together and reuse those groups through "profiles".



In more simple words, Dojo allows you to create professional DHTML & JavaScript UI Components in easy way. To feel more about what Dojo can do, I recommend you to take a look at the Demos Page.
There are really very exciting features such as the FishEye Widget which is something like rendering the main toolbar in Apple's Mac OS Desktop but inside the browser!

So what you have to do in order to start playing with Dojo. First, download Dojo's Toolkit from the main web site. Second, Extract the downloaded archive into a test folder called for example "dojo" inside a "js" folder which in turn is in the root demo folder called for example "DojoTest". Third, Create a normal HTML file with the code in the image below and name it "index.html".

I assume that the code in the screenshot is self explanatory. It just import the desired dojo's libraries on Loading and then demonstrates how to create a button widget and associate an event with it.If you have a basic knowledge of JavaScript, then you should not find any difficulty with this simple example.

dojoSampleCode


The good news is that as you see till now, there is no server side code in the HTML page which means that we do not need a web server to run our example, just browse the page. Of course this is not the case always in real applications as you should integrate Dojo with PHP or JSP or any server side scripting language.

Where to go from here? The best place to go to now is to read Dojo's Developer Book. It contains very clear and easy explanation on every detail about this wonderful framework with samples on nearly everything.

No comments: