3. Domain Model

graphic
Figure 1, Domain Model
     
The ChatDispatcher handles the implementation specific to the chosen Instant Messaging System, in this case, IBM/Lotus Sametime.  For each chat initiated with the PA Bot, the ChatDispatcher creates a new ChatMediator with the user as an ID. The ChatDispatcher passes the appropriate text strings to the ChatMediator for processing and sends the resultant text strings back to the user via the Instant Messaging System.
The ChatMediator queries each object derived from CommandType to see if they can handle the user string (also known as a request).  The command that can handle the request without error is given the request to process.  If a command cannot be found to handle the request without error then the ChatMediator will pass the request to the Command that gives an error. If no command can handle the request then an error is returned.
Please refer to the JavaDocs for more information.