Jump to content

User:Ljr1981/Action Queue: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Ljr1981 (talk | contribs)
No edit summary
Ljr1981 (talk | contribs)
No edit summary
Line 5: Line 5:
== Types of Action Queues ==
== Types of Action Queues ==
=== Simple Action Queue ===
=== Simple Action Queue ===
A simple example of an action queue is a change action queue on some software element, usually a visual control such as a text box, where a user is making changes to the content of the control. In this instance, other software objects will want to `subscribe' to the change events of the control. An example of such a construct is:
An example of a simple action queue is a `change action' queue on some software element, usually a visual control such as a text box, where a user is making changes to the content of the control. In this instance, other software objects will want to `subscribe' to the change events of the control. An example of such a construct is:


<source lang="eiffel">
<source lang="eiffel">

Revision as of 17:13, 28 March 2011

Action Queue

An Action Queue is a object oriented software construct where object routines are queued for delayed execution. Action Queue's are unlike a message queue's, which hold messages between Publishers and Subscribers. Action Queue's do link Publishers and Subscribers together, but the relational basis are the actions (routines) to execute rather than messages to be communicated and acted upon (e.g. message queue's).

Types of Action Queues

Simple Action Queue

An example of a simple action queue is a `change action' queue on some software element, usually a visual control such as a text box, where a user is making changes to the content of the control. In this instance, other software objects will want to `subscribe' to the change events of the control. An example of such a construct is:

text_box.change_actions.extend (agent save_button.enable_sensitive)

In the example, `change_actions' is an action queue into which a save buttons' `enable_sensitive' is placed. When the user makes a change to the text box contents, the change event will cause each of the action agents placed in the queue to be executed in turn. Thus, the save button will become enabled as soon as the user has made any change to the contents of it.

Subscriber/Publisher Decoupling

There are times when subscribers need to be decoupled from direct knowledge of their publishers. For instance: A window might have various container views that want to intercept save or edit actions, linking them to alternate action queues instead of the primary queues for the window. In this case,

References