Wednesday, May 21st, 2008
The Zend Framework aims to be a top notch framework for building next generation Web applications in PHP. Dojo has similar aims on the front-end side, so they decided to join forces to provide an integration layer. If you like the combination you will have a better, tighter, way to build your applications.
What we see in the initial release is:
JSON-RPC Server: We are re-working the Zend_Json_Server that has
been in our incubator since, oh, what? 0.2.0? and never released to
actually follow a specification:
will allow it to work seamlessly with Dojo, as well as other toolkits
that have JSON-RPC client implementations. I have actually completed
work on this, though the proposal is waiting to be approved; if you want
to check it out, you can find it in the
The original Zend_Json_Server implementation will be abandoned. It was
never fully tested nor fully documented, which has prevented its
release. Additionally, since it implemented its own ad-hoc standard, it
did not provide the type of interoperability that a true JSON-RPC server
implementation will provide. I am excited that we will finally be able
to provide a standards-compliant solution for general availability.
One final note: there are currently two different JSON-RPC
specifications, 1.0 and 2.0. My goal is to support each, though for the
time being, only version 1.0 will be supported, as that is the version
Dojo currently targets.
dojo() View Helper: Enabling Dojo for a page is not typically as
trivial as just loading the
dojo.jsscript — you have a
choice of loading it from the AOL CDN or a local path, and also may want
or need to load additional dojo, dijit, or dojox modules, specify custom
modules and paths, specify code to run at
specify stylesheets for decorating dijits. On top of this, this
information may change from page to page, and may only be needed for
a subset of pages. The
dojo()view helper will act as a
implementation, and facilitate all of the above tasks, as well as take
care of rendering the necessary
scriptelements in your page.
Form Element implementations: One area that developers really
types of form input can benefit from advanced and rich user interfaces
etc. Additionally, many like to use client-side validation in order to
provide instantaneous validation feedback to users (instead of requiring
a round-trip to the server). We will be identifying a small group of
form elements that we feel solve the most relevant use cases, and write
Dojo-specific versions that can be utilized with
(One thing to note:
Zend_Form‘s design already works very
well with Dojo, allowing many widgets and client-side validations to be
created by simply setting the appropriate element attributes.)
standard storage interface; services providing data in this format can
then be consumed by a variety of Dojo facilities to provide highly
flexible and dynamic content for your user interfaces. We will be
building a component that will create dojo.data compatible payloads with
which to respond to XmlHttpRequests; you will simply need to pass in the
data, and provide metadata regarding it.
Of course, you can continue to any Ajax library in conjunction with the Zend Framework, and ditto for Dojo…. but why did this match happen?
There are many synergies and similarities between the two projects and their communities, including:
- Licensing and IP: Both projects are very business friendly.
- Design affinity: Similar philosophies, including a strong emphasis on use-at-will architecture.
- JSON format used strongly in both
- Comprehensive Ajax Solution: Dojo has it all
- Standards: “Dojo not only implements published standards, but also drives them”
- Communities and support: Strong communities, with support offerings behind them
And, here is some code from a JSON-RPC demo:
- <h2>Dojo JSON-RPC Demo</h2>
- <input name="foo" type="button" value="Demo" onClick="demoRpc()"/>
- < ?
- $this->headScript()->captureStart(); ?>
- function demoRpc()
- var myObject = new dojo.rpc.JsonService('/json-rpc.php');
- < ? $this->headScript()->captureEnd() ?>
Posted by Dion Almaer at 10:01 am