• No results found

2.6 Conclusion

3.1.1 The johar.gem package

Thejohar.gempackage is responsible for the following activities:

(1) Invoking methods in the app engine;

(2) Communicating input data (i.e. commands, parameter values, and question responses elicited by the user via the interface interpreter) to the app engine, and also communicating output data from the app engine to the interface interpreter.

Figure 3.1 shows all the classes in the johar.gempackage. GemSetting interfaces with interface interpreters, while Gem interfaces with app engines. In other words, an interface

3.1. Review andRedesign ofJoharComponents 21

interpreter sends user inputs to and receives output data from an app engine via GemSetting, while the app engine receives user inputs from and sends output data to the interface interpreter viaGem. johar::GemBaseImplementation johar::GemImplementation «Interface» johar::GemBase «Interface» johar::GemSetting ApplicationEngine johar::GemFullImplementation InterfaceInterpreter

GemFullImplementation knows that it is also a Gem, so it can pass itself to the Application Engine.

ApplicationEngine just knows that it has a Gem and therefore cannot use the services offered by GemSetting.

johar::GemFactory

«Interface» johar::Gem

InterfaceInterpreter can get a GemSetting from GemFactory.

GemFactory knows it is returning a GemFullImplementation, but InterfaceInterpreter does not.

Therefore, InterfaceInterpreter cannot use the services offered by Gem.

Figure 3.1: The Class Diagram of thejohar.gemPackage

The GemFullImplementation andGemImplementation are the brains behind the activities of GemSetting and Gem respectively. Specifically, GemSetting forwards the commands, parameter values, and question responses it received from the interface interpreter to

GemFullImplementation, which then invokes the appropriate method in the app engine for computation to begin, and also makes the parameter values and question responses available to GemImplementation for use by the app engine throughGem. Furthermore, Gemforwards the table data or text it received from the app engine to GemImplementation, which then

makes the data accessible to GemFullImplementation for use by the interface interpreter throughGemSetting.

The Review Process

Our review of the 2009 version of johar.gempackage is aimed at determining whether the two activities outlined in subsection 3.1.1 are effectively carried out by the package. To achieve this aim, we reviewed the functionality of all the classes in this package.

The outcome of our review revealed the critical shortcomings outlined below. Afterwards, we explain the cause and effect of these shortcomings on the Johar project.

(1) GemSettingdid not have the feature needed to automatically initialize all tables that are supposed to hold table data coming from the app engine, when an interface interpreter is started by the user.

(2) GemSettingdid not have the feature needed to automatically validate all the app engine methods used in an IDF against the actual methods in the app engine.

(3) GemFullImplementationwas passive in determining which app engine method to invoke or trigger for computation to begin. It relies onGemSettingto provide the method name, which meansGemSettingmust get this information from the interface interpreter.

(4) GemFullImplementationdid not validate each parameter value received fromGemSetting

against the parameter type in the IDF. This means that GemFullImplementation could accept an integer value for a parameter declared asfloatin the IDF.

These shortcomings occurred because the 2009 version of johar.gem package did not access the IDF at all. As stated in chapter 1, the IDF provides information about the nature of an app (such as app name, name of app engine, app engine methods that perform specific functions, etc.), functionality or features available to users (such as commands, help facility, table browsing, parameter selection, answering questions, etc.), and the type of data to be exchanged between interface interpreters and the app (such as textual data, boolean values, integer values, files, calendar date and time, etc.). Unfortunately, as important as these pieces of information are, the 2009 version of johar.gempackage had no knowledge of them.

The major effect or consequence of this knowledge gap is that the interface interpreter, which has access to the content of an IDF, must bridge the gap by initializing all tables at launch time, validating all app engine methods used in the IDF (which can only be achieved by collaborating withGemSetting), informingGemSettingwhich app engine method to invoke in order to perform specific task, and validating all parameter values against their corresponding

3.1. Review andRedesign ofJoharComponents 23

types in the IDF. This means extra work for interface interpreter developers, since they will have to worry about these issues, rather than focusing on developing quality ability-based user interfaces. In addition, the performance of interface interpreters is reduced by these extra checks and balances.

The Redesign Process

Our redesign process was aimed at restructuring theGemSettingandGemFullImplementation

classes in the 2009 version of johar.gem package such that they could make certain decisions based on the content of IDFs without having to contact the interface interpreters for information.

We added new methods and rewrote existing methods inGemFullImplementationso as to address the shortcomings. These new and modified methods handle the following: initializing the app engine and all tables mentioned in the IDF, validating all the app engine methods used in an IDF against the actual methods in the app engine, automatically determining and invoking app engine methods to perform specific tasks (e.g. invoking command methods specified in the IDF, invoking methods to compute and retrieve default values for parameters, etc.), and validating each parameter value against its type in the IDF. These methods are accessible to the interface interpreter throughGemSetting, and can be called when needed.

Thus, the interface interpreter developers can now focus majorly on the design of user interfaces. Also, the performance of interface interpreters is improved, thereby boosting user experience and satisfaction.

Related documents