Understanding Sync Layers in YUI

A Sync Layer is an interface where the widget, e.g. {javascript}DataTable{/javascript}, is populated, updated from, and updates a data store. In our case, the data store is a RESTful interface using JSON.

To implement YUI Sync Layers, we use a {javascript}ModelList{/javascript} composed of Models. To understand Models, we go back to the basics and look at {javascript}Attributes{/javascript}.

{javascript}Attribute{/javascript} implements getter/setter functionality for a class attribute, which is called member data in C++. {javascript}Attribute{/javascript} is normally not used directly. Rather, implementations extend {javascript}Base{/javascript} which incorporates {javascript}Attribute{/javascript}, handles attribute setup, and adds lazy initialization to all attributes, improving performance.

Leave A Reply