Book Image

Learning Dojo

By : Peter Svensson
Book Image

Learning Dojo

By: Peter Svensson

Overview of this book

<p>Dojo is a popular AJAX-specific open-source JavaScript framework for building powerful web applications. It provides a well conceived API and set of tools to assist you and fix the issues experienced in everyday web development. Your project size is no concern while using Dojo. It is the best scalable solution to all your size-related issues.<br /> <br />This book starts by giving you tips and tricks for programming with JavaScript. These tricks will help you with Dojo. With every chapter, you will learn advanced JavaScript techniques. You will learn to leverage Dojo for a clean web application architecture using JSON or XML.</p>
Table of Contents (13 chapters)
Learning Dojo
Credits
About the Author
About the Reviewer
Preface
Free Chapter
1
Introduction to Dojo

Remote procedure calls


The XHR functions are versatile and very powerful, but can be cumbersome when what you want to do is not to transfer data, but just call a function. As long as the function can be invoked with a HTTP request, XHR is fine for that also, but Dojo's RPC functionality provides a better alternative.

When using dojox.rpc, you create an object which has stub functions that take arguments and construct XHR requests behind the scenes when called.

Another good thing about dojox.rpc is that it hides the implementation so that it becomes a natural dividing line between different parts of your application.

It might seem a bit roundabout to follow the exact dojox.rpc specification just to get a little separation between layers in your code, and that's of course arguable. However, the most common use case for dojox.rpc is using a remote procedure call that has already been made for you.

For instance, Dojo contains several ready-to-go services in dojox.rpc format, hiding their exact...