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
No edit summary
Line 1: Line 1:
{{Userspace draft|source=ArticleWizard|date=March 2011}}
{{Userspace draft|source=ArticleWizard|date=March 2011}}
== Action Queue ==
== 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).
An '''Action Queue''' is a object oriented software construct where object routines are collected or 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).

Action Queues or Action Sequences, are collections of routines. The routines are defined functions on objects in a running computer program. The routines themselves have been turned into objects. In the [[Eiffel]] programming system and language these objectified routines are called Agents. Such agents are not to be confused with [[Software agent]]'s, which are another paradigm altogether.

The Agents collected into Action Queues are based on [[Lambda Calculus]].

"Lambda calculus gives us a theory of the notion of function, reduced to its essence: not any particular kind of function, such as the functions of trigonometry or real analysis with their specific properties, but the very idea of a function as a mechanism that takes arguments and yields a result. This is the mathematical notion of function, but since it underlies the concept of routine in computer science the theory will give us new insights directly relevant to programmers: what is the scope of a variable, what is the role of an argument, and how can we treat a routine as if it were an object — the very goal that this chapter pursues by wrapping routines into agents."


== Types of Action Queues ==
== Types of Action Queues ==
=== Simple Action Queue ===
=== Direct or Tightly Coupled ===
In the simplest form, a Publisher and Subscriber are linked when an Agent.

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:
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:


Line 13: Line 21:
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.
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 ===
=== Indirect or Decoupled ===
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,
Subscribers can be decoupled from direct knowledge of or operation with 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 ==
== References ==
<!--- See http://en.wikipedia.org/wiki/Wikipedia:Footnotes on how to create references using <ref></ref> tags which will then appear here automatically -->
<!--- See http://en.wikipedia.org/wiki/Wikipedia:Footnotes on how to create references using <ref></ref> tags which will then appear here automatically -->

Revision as of 11:44, 29 March 2011

Action Queue

An Action Queue is a object oriented software construct where object routines are collected or 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).

Action Queues or Action Sequences, are collections of routines. The routines are defined functions on objects in a running computer program. The routines themselves have been turned into objects. In the Eiffel programming system and language these objectified routines are called Agents. Such agents are not to be confused with Software agent's, which are another paradigm altogether.

The Agents collected into Action Queues are based on Lambda Calculus.

"Lambda calculus gives us a theory of the notion of function, reduced to its essence: not any particular kind of function, such as the functions of trigonometry or real analysis with their specific properties, but the very idea of a function as a mechanism that takes arguments and yields a result. This is the mathematical notion of function, but since it underlies the concept of routine in computer science the theory will give us new insights directly relevant to programmers: what is the scope of a variable, what is the role of an argument, and how can we treat a routine as if it were an object — the very goal that this chapter pursues by wrapping routines into agents."

Types of Action Queues

Direct or Tightly Coupled

In the simplest form, a Publisher and Subscriber are linked when an Agent.

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.

Indirect or Decoupled

Subscribers can be decoupled from direct knowledge of or operation with 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