Download presentation
Presentation is loading. Please wait.
Published byLynette Murphy Modified over 9 years ago
1
Framework for Interactive Applications Matthew Korchinsky Advisor: Aaron Cass Senior Project – Computer Engineering – 2006 Abstract The Java language was written to accomplish many different tasks therefore it is made up of a large number of classes. Although Java is extremely versatile it can be cumbersome to use when one is designing an interactive application, especially for beginners. One negative aspect is the complex listening system Java uses to service events. When one is learning event programming the listening system can be complex and difficult to learn. Another is the large amount of possible classes to use to create an effective Graphical User Interface. Although this allows for many different designs it could overwhelm the programmer. This project seeks to aid both of these problems by creating a new event system and a tailored set of classes that can be used in a wide variety of interactive applications. Inspiration and Background The idea for the new event system comes from a framework called QT which is used for C++ (www.trolltech.com). This system uses a “Signal – Slot” relationship instead of listeners to respond to events. When the programmer is creating their application, signals are simply “connected” to slots. At runtime, when the signals are emitted in the program, the appropriate slot is retrieved and invoked. QT uses a automatic code generation script for the code to invoke methods, however this piece of the event system was improved upon in the Java version. Evaluation The source code was given to three students. All three students had varying levels of Java knowledge ranging from intermediate event programming experience to expert event programming experience. The students were asked to write a simple application with two buttons that printed out different statements based on what button was pressed. They had to perform this task using the new framework and the old Java listening system. The new event system received mixed reviews and the students stated their previous knowledge of Java listeners as the reason. Connections and Data Structures The connections are managed using a Java HashMap data structure. In each connection there are four objects that must be stored, however a HashMap can only relate two objects. The source and signal had to be packaged together using a new data structure (SourceSignalPair) and the destination and slot were also packaged together (DestSlotPair). This allowed the HashMap to be used to relate a SourceSignalPair to a DestSlotPair. Connect, Emission of Signals, and Reflection To connect a signal to a slot the user must specify the source of the event, the signal name, the object where the slot is defined, and the slot name. The user can also define their own signals and emit them at the appropriate time using the emit method. They can specify the source, signal name, and the required parameters when calling the emit method. To alleviate the problem of an automatic code generation script Java Reflection was used to invoke the slots when the signals were emitted. Future Work More time can be devoted to creating a tailored set of classes that can be used across a wide variety of interactive applications. Also a new evaluation would be helpful among event programming beginners to determine whether the goal of the framework has been truly achieved.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.