Friday 18 January 2008

CAB Quick description

Composite Application UI Block (CAB)
CAB is a methodology for building user interface applications composed of modular blocks.

Modules
The working application is organized in terms of modules which can be plugged or unplugged without affecting the whole application. But, unplugging a module implies the disactivation of certain functionalities of the application. Modules communicate between them in a loosely coupled manner by using an event broker system.

Workitems
Each module contains one or more workitems. A workitem can be analogous to a Use Case (UML) and is a logical area (in memory) of the application, where we store items useful for one use case and eventually its sub use cases. WorkItems can contain sub workitems and elements such as Views (User controls), Services (instance of classes exposing methods to the whole workitem) and State variables. In fact, the workitem is a container where we "dump" things we need for executing a particular use case. It is to be noted that Views placed in a workitem are not directly displayed on screen. For this purpose we need CAB workspaces. Moreover, the parent of all workitems in a CAB application is the RootWorkItem. This workitem is created automatically.

Shell.
The shell is the starting project of your application and has the role of initializing the environment necessary for the execution of your application.

WorkItem state.
State variables are like web session variables where we store values in a key-value style. These values are then accessed or removed from the workitem by using the appropriate state key.

Services.
Services are classes instantiated and stored in a workitem. These methods are then accessible anywhere in the workitem and its subworkitems.

Workspaces.
Workspaces are placeholders on screen where we will display our user controls (Views). CAB proposes several types of workspaces such as MDI and tabbed workspaces. The MDI workspace, for instance, is used to display our user controls as child windows into our parent application.

CAB Event broker.
Communication between CAB modules is ensured by the CAB event broker. A module which needs to trigger an action in another module "publishes" (event publication) a message to the event broker which invokes all modules which have subscribed (event subscription) to the event.

No comments: