Chapter 7. Infrastructure
If you do some cursory searches about YUI, you might hear people say that it’s “an Ajax library with widgets.” Dig a little further, and you’ll probably hear phrases like, “YUI supports rich web applications,” or that it “helps provide structure,” or that it “scales well with larger code bases.”
Well, that’s easy enough to say—but what is it specifically about YUI that makes it suitable for larger applications? Arguably, this boils down to a handful of key features.
The first is YUI’s Loader and module system, which makes it possible to efficiently reassemble just the chunks of code you need, when you need them.
The second is YUI’s highly configurable custom event system, which provides an obvious way to decouple components.
The third is YUI’s ecosystem of tools for testing, deploying, and documenting your professional-grade code.
The fourth is YUI’s Base
infrastructure, discussed
in this chapter.
The YUI Base
object is the
fundamental building block for major YUI components and apps. Casual users
of YUI don’t necessarily need to know much about Base
, but if
you’re a component builder, you should understand that much of the library
either powers Base
, or is powered by it. Base
’s
descendants include:
Widget
, the foundation forOverlay
,Slider
,Calendar
, and all other core widgets. This chapter explains how to create your own widgets from scratch. For example usage of the core widgets, refer to Chapter 8.Utility objects such as
Cache
,DataSource
,RecordSet
, and ...
Get YUI 3 Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.