Thursday 15 September 2011

Introduction to iWidgets

A widget is a small, stand-alone application that can be run on the desktop or within a web page. Widgets are intended to be simple, single purpose applications that can be combined or "mashed together" to provide added functionality and content for the users. Widgets are particularly useful when creating portal sites. Portal web pages are designed to allow users to pick and choose the content they want to view on a single web page for convenient access.

Widgets, by definition, are designed to be reusable components. They fit perfectly within the current information technology objectives of creating reusable, web-based components that encapsulate and isolate the information that they provide. The following examples are widgets:
1.      Stock ticker
2.      Sports ticker
3.      Local weather
4.      Social networking
5.      World clock
6.      Games
7.      Advertising

iWidgets are widgets that are based on the IBM iWidget Specification. The IBM iWidget Specification is a framework that defines characteristics of HTML markup, metadata formats, and JavaScript services for enabling the aggregation of iWidget components into a single Web application. 

iWidgets are configured in an XML file. The XML file contains several parts that describe the widget, including content, events, event descriptions, itemsets, items, and resources. 

iContext:

The context of the iWidget runtime environment manages the iWidget. This context includes any user interface (UI) controls, coordination between iWidgets, and interaction with the backend service.

Events and event descriptions

Events are used to exchange information between the separate content views of the widget, as well as between other widgets. As with other web technologies, events are useful for providing data to your widget and changing state.
Event descriptions are the payload of the event. They describe the type of data that is being exchanged and descriptive text that can be displayed to the user. Events are associated with event descriptions so that when an event is triggered, the widget knows the data that will be passed with it.

Itemsets and items

An itemset is a simple definition of the data that is used by the widget. It provides an abstraction of a data store for the data. More complex data stores can be configured, but the itemset is the simplest implementation available.
Items detail the individual attributes of the itemset. Items can be the stock price, company symbol, and time last updated. Item descriptions also maintain the data type of the attribute and descriptive text that can be displayed to the user.

Resources 

iWidget resources allow you to include external source files into the iWidget. This feature allows you to set up Cascading Style Sheet (CSS) files, JavaScript files, and other file resources that are used by the iWidget. Providing for separate files supports good coding standards, maintainability, and team development.

No comments:

Post a Comment