Official website

Monday, December 8, 2014

The power of reflection

In this post we've explained a scenario that consisted by a number (3) of alternative responses. Someone might consider, what if I want to use the response or some other action, like evaluation, to another activity? Should I make duplicates or a number of responses for each one of them? The answer is no. This can be solved by creating the response or some action as a launcher. A launcher creates two instances. One that holds the action and the other the reflection. The reflection is indicated by asterisk symbol.

For example, if I create a new launcher 'demo_launcher' that holds 'Hello %user%' as action, then the system will create:

1. *demo_launcher: Hello %user%
2. demo_launcher: *demo_launcher

When 'demo_launcher' is called the response will look like this...

Hello john (where john the system login. Check Built-in functions and API for more info)

Now, from a different Instruction Set that returns for example the user status, *demo_launcher can be invoked like this..

get_user_stat: *demo_launcher. Your status is set to %whereami%.

which will return...
Hello john, your status is set to present.

I think it's a very straightforward methodology and will become a standard in the future versions.

Screenshots are from the development version which is not yet available. However the functionality remains.


Of course these actions can be applied to any system object, such the evaluator.


Chain reaction behind the scenes.


Launchers are extremely versatile. You can combine anything that supported from the framework in a single action.
So, the verdict is that if you want a complex Instruction Set it is wise first to create launcher components and then mixed in a single one.

You can review a complex AppConfig.xml configuration file.

No comments:

Post a Comment