Search |
||
jMaki data models formally specifiedPosted by carlavmott on July 30, 2007 at 10:32 PM PDT
The jMaki data models have been formally specified and as of last week, build .9.6 implements all specifications. The data model pages include the formal specification of the data expected by the widgets. They also include information about the event types and payloads published by the widgets as well as the event types and payloads expected by the widget subscribers. You will find lots of examples to help you get started. When you look at the pages you will see that the data models are described using BNF. I like this format because it specifies what is legal as well as what is not legal. The data models are defined for the various types of widgets such as menus, trees. tables, tabbed views etc. The data models are consistent across the widgets regardless of the underlying toolkits. The jMaki widget wrappers convert the data from the jMaki data models to the model the underlying toolkits expects. This way you can switch between the toolkits without having to change the data format. Also the widget wrappers include publishers and subscribers so that dynamic widget to widget communication is greatly simplified. I'll talk more about the publishers and subscribers later in this blog. In all cases you will see a set of properties that are common across the models. I'll go over some of these properties but see the main model page for a complete description.
We tried to be consistent across the models so that users would learn one model and most if not all the information would carry over to the other models. Something that is new to the models is the action property. The action property is a declarative way of associating widget behavior. This is extremely powerful for simple operations because no JavaScript code is required to affect another widget. As a result of adding actions we found that we needed to describe the event model as well. Widget to widget communication is simplified because now the widgets also subscribe to various topics out of the box. They also include handlers for those topics. This means that you can publish to a topic which a widget is subscribed to, passing along the correct data and you can affect the behavior of that widget. This works much the same way as I described in my previous blog jMaki - widgets talking to widgets only you pass all the needed information as an action. See Greg's blog for a example on how to use actions . As I mentioned above the widgets now subscribe to topics and handle certain events. The underlying mechanism for communication is still publish/subscribe (see the article 'A practical guide to jMaki events' for details on events in jMaki). The main idea is that widgets now subscribe to one or more topics such as '/yahoo/tabbedview/select'. There is a handler in the widget code which parses the message or payload and performs some action based on the topic name and the payload received. Consider the case of the tabbed view. The widget subscribes to the topic 'select' and contains a handler which expects the id of the tab which should be selected. By simply publishing a message to that topic containing the tab id to be selected you can affect which tab is visible on the page. What all can you do? What are the subscribers and what data is required? All these questions are answered in the model pages. You will find the list of events that are handled as well as the payload expected for each type of event. »
Related Topics >>
Web Applications Comments
Comments are listed in date ascending order (oldest first)
|
||
|