How do Assistants interact with other parts of the application?

Assistants are free floating modeless windows.

They communicate with the rest of the application by signaling events to it.

The respond to the rest of the application by listening for events signaled by it.

This very simple architecture is flexible and extensible.

Here's some examples of simple even driven interactions:

Example 1 – A classic F4= Prompt style request 

An order entry form is asking the user to input a customer number.

The user indicates that they would like to prompt the customer by pressing a button or an image (e.g. a question mark).

The Order Entry form signals a "SelectCustomer" event and may optionally include details of information already input by the user (e.g. partial customer name, number etc.) as part of the "payload" associated with the event.

The Customer Assistant detects the "SelectCustomer" event and allows the user to search for the required customer. The "payload" associated with the event may be used to speed up or narrow the initial search. When the user locates and selects the required customer the Customer Assistant signals a "CustomerSelected" event and would include the customer number (and maybe their name) as the "payload" associated with the event.

The Order Entry form detects the "CustomerSelected" event and updates the details of the order being input with the selected customer details. 

Example 2 – A more advanced non-modal prompt request 

An Order Entry form is currently active.

The Customer Assistant window is also floating around.

The user goes directly to the Customer Assistant window and searches for a customer. When they select it the Customer Assistant signals a CustomerSelected" event and would include the customer number (and maybe their name) as the "payload" associated with the event.

The Order Entry form detects the "CustomerSelected" event and updates the details of the order currently being input with the selected customer details. 

In web applications particularly this is a more efficient way to perform prompting because it cuts out the number of interactions with the remote server that are required to complete the interaction.

Example 3 – Multiple Item Prompting

Event driven processing allows multiple item selections.

An Order Entry form is currently active.

The Product Assistant is window also floating around.

The user goes directly to the Product Assistant Window and selects four different products. When they have completed this selection the Product Assistant signals a "ProductsSelected" event. It would include a list of product numbers (and maybe product descriptions) in the payload of the "ProductsSelected" event.

The Order Entry form detects the "ProductsSelected" event and updates the details of the order currently being input with the all the products selected. 

Example 4 – Some other uses for Assistants

Here's some ideas for extending the concept of an Assistant …