290 likes | 401 Vues
Dive into the world of Rich Internet Application development with this comprehensive guide on using DOJO to build powerful web applications. Learn about handling browser incompatibilities, building widgets, and managing events efficiently. Explore the advantages and challenges of using DOJO and discover practical tips and solutions for common issues. Whether you're a seasoned developer or new to RIA development, this book will equip you with the knowledge and skills to create engaging web experiences.
E N D
Blood on the Keyboard Experiences in developing Rich Internet Applications. Brendan Lawlor, DSI.
Decare Systems Ireland • Based in Bishopstown, Cork. • 150+ • 140+ actually writing code for a living • Java and .NET • Enterprise Intranet Applications • E-commerce Internet Applications
Themes • Rich Internet Application development • Creative Development, XHTML, CSS, Javascript. • AJAX – a small but vital part of RIA development. • DSI’s experience in building RIAs.
RIA Philosophy: Before Javascript Sucks
RIA Philosophy: After Javascript Still Sucks -but DOJO makes it a lot less sucky
Why DOJO? We needed a safer way to use Javascript. JSF ?
JSF The RIA Platform GWT DOJO CSS XHTML JS Browser
What is DOJO? • It is a set of JavaScript libraries • Handles browser incompatibilities • Hides XMLHttpRequest processing • Provides for the building of Widgets • AOP in JavaScript!
DOJO packages • dojo.widget • dojo.event • dojo.io dojo.require(“dojo.widget.*”);
DOJO Libraries: dojo.widget <select class=“cb”> <option value=“Java">java</option> <option value=“Script">script</option> <option value=“Still">still</option> <option value=“Sucks">sucks</option> </select>
ComboBox.html <select class=“cb” dojoType=“ComboBox”> <option value=“Java">java</option> <option value=“Script">script</option> <option value=“Still">still</option> <option value=“Sucks">sucks</option> </select>
ComboBox.css .cb{ position: relative; top: 0px; }
ComboBox.js dojo.provide(“ComboBox"); … dojo.widget.defineWidget( “ComboBox”, templatePath:/ComboBox.html templateCssPath:/ComboBox.css … //Event-Driven Behaviour
Creating the Widget <div dojoType=“ComboBox">
DOJO packages • dojo.widget • dojo.event • dojo.io
DOJO Libraries: dojo.event • RIA = component-based, event-driven • JS Events = cross-browser hell • DOJO = cross-browser event management • Also abstracts over all events.
DOJO packages • dojo.widget • dojo.event • dojo.io
DOJO Libraries: dojo.io • Abstracts the XMLHttpRequest • Everything is a ‘bind’ dojo.io.bind({ url: "http://foo.bar.com/read", load: function(type, data, evt){ /*read something*/}, mimetype: "text/json“ formNode: dojo.byId(“myForm”) });
Natural Habitats We have a dedicated creative team: • No advantage of Java over Javascript. • They could work on both server platforms using DOJO alone. • Unity of platform gives unity of standards.
DOJO and Presentation Process. Pictures Wireframes WF & data
JS Controller read.json Read read.json Edit Controller edit.json .html Search Struts Actions Our DOJO Architecture
Summary • What we liked • What we hated • What we’re gonna do about it • What we wish somebody else would do
What did we like? • Easy access for our creative staff • Very little change from Struts actions downwards • JS widgets are more easily reusable • Client development without the server!
read.json read.json read.json C:\test .html Look Ma – No Server!
What did we dislike? • Widgets on Internet Explorer 6 • DOJO 0.3 and IE6: a match made in Hell • Irresistible force meets immovable object
What Next? • DOJO 0.9 just released • Hopefully will deal with IE6 problem
Final thoughts • Just another view on how to write RIAs. • Not an attempt to say that DOJO is better. • Whatever framework we use, we need to live with JS. • Would somebody write a JS GUI builder already!?
Resources and Credits • DSI: Paul Sheehan, Michal Bali, Conor Goulding • Sun: Sang Shin (Introduction to Dojo Toolkit) • http://dojotoolkit.org • http://blog.decaresystems.ie