Teach yourself the YUI by Dan Wellman
The next book by PACKT Publishing is going to teach you the basics of modern JS framework
for designing and creating web application’s user interface. This framework is called Yahoo! User Interface Library and it’s distributed freely under the terms of the BSD licence.
Thanks God we can say that the old times when each developer made his own hyperawesome functions for user interfacing has nearly gone. Fortunately the handsome and cute complex frameworks are coming, solving a lot of the problems one must deal with during developing the user interface. From very simple to complex libraries, from plain addons for HTML pages to state-of-the-art systems. Yahoo! User Interface (YUI) is one of the second ones - big, complex and powerful, such as Dojo or ExtJS (ExtJS starts like YUI extension, btw). You can get an imagine about its possibilities from its demo page. When you decide to step one level above the dealing with ad-hoc JS hacks for each project, then YUI is a perfect starting point, whether you use it or not.
If you wanna enter the amazing world of the UI frameworks, the book Learning the Yahoo! User Interface Library is a must-have thing. This book isn’t for total beginners, you have to meet some pre-requisities, such as knowing
JavaScript, CSS, HTML and so on.
The author begins his book with a brief introduction into the YUI world - what is it, what is it for, why YUI - he talks about the cross-browser compatibility and introduces the basic parts of YUI, describing the basic techniques in YUI, such as code inserting, component using or setting up their parameters. All of these techniques are illustrated on a simple example: INPUT field extended by a calendar.
One of the classical problems a web developer can deal every day with is the different default styling with different browsers. You have to use so called „CSS Reset“ to make your applications look (more or less) the same way. YUI has tools for CSS resetting too. Long story short: It’s a set of cascade styles, which
sets overall attributes to common (and predictable) values across the browsers. YUI provides the CSS for font resetting and grid layouting too. And all of this is described in the second chapter.
The third chapter describes the fundaments of the inner logic of YUI, such as namespaces, DOM utilities and event-handling model. The description isn’t much deep, so you will not drop out during reading about the
seventy-fifth method for children search. Just the logic of the DOM and a couple of the often
used methods are described.
YUI deals, of course, with the web applications fundamental engine - yes, I mean AJAX. The chapter four is all about AJAX and the Connection manager, which plays a big role within the client-server communication in YUI, providing the XHR encapsulation the same way like the rest of YUI does. The author uses two examples -
simple RSS reader and login system - to cover this theme.
The fifth chapter joins two different things which should stay separated, I mean. The animations and the browser history management. The animations are a basic of the graphics effects or the animated widgets (like the accordion widget), but the Browser History Manager (the second part of this chapter) provides the correct function of the browser’s BACK button in the AJAX-based applications and should be discussed in the chapter four, I guess.
The chapter six has a simple title: Buttons and trees. The author describes the Button component and its derivates (such as the Select List Button) and the TreeView component with its building, styling, dynamic drawing, dynamic changes of tree and other useful things. The talks continue in the next chapter with the Menu navigations and using the popular Autocompleter. The chapter eight describes visual parts for logical encapsulating user interface’s elements, such as containers or the tabs, including miscellaneous panels, windows, dialogs or tooltips.
The YUI-way of Drag-and-drop is described in the chapter nine. It covers all the mouse movement operations, from a simple „drag the object over the desk“ (to the basket, for example) to all the graphics elements with draggable, movable, turnable... parts. And this theme is the end of the visual YUI parts described in the book.
In the last chapter, number ten, the author doesn’t describe any user interface element, but he deals with an important thing too. He writes about app debugging with the Logger class.
And then, suddenly, the book ends with the index. I really miss at least one page separating the text and the index, with some kind of summary, some tips for further reading, some useful links, or such. A book with such long and intensive text as this one have would definitelly deserve some „chill-out“, wouldn’t it?
But in global I give this book five stars. After many (void) attempts I’d been trying to make me reading (and understanding) the ExtJS documentations I’ve finally got a book which doesn’t bore me out like all the tutorials and „the first steps in the XYZ“ always do. I cannot say anything against this book: it’s just perfect buy!
I would recommend this book to all people interested in the web applications. YUI is really a good first step to better web applications and this book is really a good introduction to YUI.
The source codes used in this book you can download for free from the PACKT website.
You can buy this book directly from the PACKT for about 40US$ (and remember: Free shipping!)
Learning the Yahoo! User Interface Library – Wellman, Dan – PACKT Publishing 2008, 360 pages
- Chcete-li přidat komentář, přihlašte se nebo se zaregistrujte.
