Sunday, February 16, 2014

My experience with Dojo

I have been working on UI for a few years now. About 1.5 years ago, I started developing JavaScript using the Dojo framework. I wish I had been warned before I started, that its not yet another JS framework. It is/has eveything that an organization needs to build single page applications.
I felt it important to write about my experience with JS and all of the jQuery goodness before Dojo.
JavaScript is a still a new language despite the countless blogs and tutorials to help understand its good, great and not so-great parts. As a web developer who worked on different web-sites at school I naturally picked up jQuery. With it's expressiveness(chaining etc) and cross-browser support, it was easy to get addicted to it. The introduction of the jQuery UI framework was everything a web dev could ever ask for. Both(jQuery Core and jQuery UI) these frameworks together helped reduced tons of boiler-plate, provided great APIs and a rich widget set. Note that I never mentioned code organization so far. I still used to modularize my JS into functions and some name spacing. I would split code into short script files and include all of these on my page. Code organization was a problem I pretended did not exist. 

With the influx of all the jQuery plugins, I jumped head-first noodling with them and eventually using them in my projects without understanding that some of them do not have full-time support or are not maintained by their owners reliably. 

It was then that I realized that it takes a much more disciplined approach to build large web applications.

Forward to today, it has been a rich learning experience developing JS code using the Dojo framework. The require, define and declare functions, underpin the code organization. I learn of different ways every day to utilize one of dojo/_base super useful modules. It's refreshing to see the toolkit's approach to providing enhanced functionality but deferring to the browser default if native support is available, without polluting the global objects. The widget system known as Dijit, is fantastic. It not only has a rich set of widgets, but has a set of rules governing how widgets must be built. It's supports template-based widgets which is so much easier to maintain than widgets coded completely in JS. 
I look foward to sharing more of my dojo experiences as code samples in future posts.

No comments:

Post a Comment