If you have read my previous article, you have probably realised how Zen is the “art of nothing”, and how this “nothingness” creates a stabile foundation you can build upon. When I created p5.ajax, which is the Ajax library in Phosphorus Five, I built it around the wisdoms of Zen.
In fact, in p5.ajax, there only exists one Ajax widget. Just like there only exist one type of element in HTML. You can parametrise this single widget though, the same way you parametrise your HTML element, by giving it a name, some attributes, and associating Ajax DOM event handlers to it. This approach however, makes it possible for you, to incrementally build more and more complex widgets, through composition – Which allows you to create anything you wish. In System42, for instance, there exists the following widgets, entirely created using the above approach, on top of one single root widget.
- Ajax TreeView
- Ajax DataGrid
- Ajax TabControl
- Modal Ajax Windows
- Etc, etc, etc …
All of the above mentioned widgets, are entirely created using a single base widget, through composition, by incrementally creating more and more rich Ajax widgets. Zen helped me solve the Ajax problem, permanently, allowing for a single empty widget, to replace every single Ajax Control ever created on this planet. And the results, compared to other Ajax widgets, yielded up to 220 times better performance on parameters such as bandwidth usage, load time, etc.
And the bonus is that you only have to learn a single API, which is the API of this single widget, and still be able to use, consume, and create any complexity you wish in regards to your Ajax needs.