event chain reaction: combining promoted events and commuter modules
TRANSCRIPT
Event Chain Reaction:
Combining Promoted Events and Commuter
Modules
One of the Greatest Debates in Philosophy…• In 1970 a corporation launched a massive
campaign to find the answer to one of life’s greatest philosophical mysteries.
• Their efforts were extended worldwide and extended into many academic and media institutions.
• Even to this day this conundrum has perplexed the greatest scientific, philosophical, and religious minds…
How Many Licks Does it Take to Get to the Center of a Tootsie Roll Pop?
How Many Licks Does it Take to Get to the Center of a Tootsie Roll Pop?
How Many Licks Does it Take to Get to the Center of a Tootsie Roll Pop?
How Many Licks Does it Take to Get to the Center of a Tootsie Roll Pop?
364 / 252
How Many Licks Does it Take to Get to the Center of a Tootsie Roll Pop?
411
How Many Licks Does it Take to Get to the Center of a Tootsie Roll Pop?
144
How Many Licks Does it Take to Get to the Center of a Tootsie Roll Pop?
The World May Never Know!
How Many Clicks Does it Take to Get to the Center of the Script Event Editor?
Let’s do a quick case study…
The World May Never Know!
The Benefits of Promoted Events and Commuter Modules
Let’s first look at some Script and QuickEvents…
The Benefits of Promoted Events and Commuter Modules
• Assumptions:– You already have a working understanding of
promoted events.– You already have a working understanding of
commuter modules.– If one or both of the above are true, you are
willing to learn new things after this presentation.
The Benefits of Promoted Events and Commuter Modules
• Resources:– The X Events by Andrew McAuley -
http://www.sprezzatura.com/senl/senl17.htm– Creating a Custom Event by Don Bakke -
http://www.srpcs.com/dr_knowledgebase.aspx– Programmer’s Reference Manual – Chapter 10 –
Promoted Events– Promoted Events by Kevin Fournier –
http://www.srpcs.com/dr_knowledgebase.aspx
The Benefits of Promoted Events and Commuter Modules
• Deficiences in Script Events– Requires you to always close the running
window if you need to change the logic.– Creates an entity and repository record for
every event.– Have to be managed in the Script Event Editor
(unless it calls a standard routine to handle the main logic).
The Benefits of Promoted Events and Commuter Modules
• Deficiences in QuickEvents– Requires you to always close the running
window if you need to change the logic.– Can only work on a post-system event handler
basis.– Cannot handle complex logic (unless it calls a
standard routine to handle the main logic.)
The Benefits of Promoted Events and Commuter Modules
Now let’s look at a Commuter Module…
The Benefits of Promoted Events and Commuter Modules
Next we’ll look at Promoted Events…
The Benefits of Promoted Events and Commuter Modules
Finally, let’s see what can be doneby combining Promoted Events
andCommuter Modules…
The Benefits of Promoted Events and Commuter Modules
• Virtually all events can be trapped automatically.
• Inheritance flow which gives us the ability to custom manage the entire event chain.
• Events can be created on-the-fly without having to use the EventDesigner.
• Everything managed through the System Editor.
How It All Works – Promoted Events Revisited• Standard Event Handler Chain:
Event SCRIPT EVENT HANDLER
SYSTEM EVENT HANDLER
QUICK EVENT HANDLER Done
Return 1
Return 1
Return 0
How It All Works – Promoted Events Revisited• Fully Detailed Event Handler Chain:
GEN
ER
ICEVEN
TCO
NTR
OL-
TYPE
Event CONTROL SPECIFIC EVENT HANDLERScript Event Handler
Done
Return 0
APPLICATION EVENT HANDLERPromoted Event Handler
INHERITED APPLICATION EVENT HANDLERPromoted Event Handler
SYSPROG EVENT HANDLERSystem Event Handler
APPLICATION EVENT HANDLERPromoted Event Handler
INHERITED APPLICATION EVENT HANDLERPromoted Event Handler
SYSPROG EVENT HANDLERSystem Event Handler
APPLICATION EVENT HANDLERPromoted Event Handler
INHERITED APPLICATION EVENT HANDLERPromoted Event Handler
SYSPROG EVENT HANDLERSystem Event Handler
QUICK EVENT HANDLER
How It All Works – Promoted Events Revisited• Points of Interest
– Script events are always first in the chain.
– QuickEvents are always last in the chain.
– System Event Handlers are technically Promoted Events written in SYSPROG. (Or…Promoted Events are technically System Event Handlers written at the local application level).
How It All Works – Promoted Events Revisited• Conclusions
– Promoted Events give us a way to process events prior to the System Event Handler.
– By creating a generic Promoted Event in the local application we can effectively create a promoted post-System Event Handler for all events (even custom ones).
– The only promoted pre-System Event Handlers we need are for events that truly need pre and post handling: e.g. READ, WRITE, DELETE, CLOSE, and CLEAR.
How It All Works – Putting it All Together• Set up Promoted Event shells that call a special “commuter
module”. Here are some examples…
• Design your Promoted Event commuter module to call your window commuter modules first, your individual Promoted Event commuters next, and then the System Event Handler. Here is a model that we use…
• Here is what a typical window commuter module looks like…
• Here is what a typical promoted event commuter module looks like…
• Notice how the event flow is controlled at every step.
Thank You
Any Questions?