Responders: Language Support for Interactive Applications
A variety of application domains are interactive in nature: a primary task involves responding to external actions. In this paper, we introduce explicit programming language support for interactive programming, via the concept of a responder. Responders include a novel control construct that allows the interactive logic of an application to be naturally and modularly expressed. In contrast, the standard approaches to interactive programming, based on the event-driven style or the state design pattern, fragment this logic across multiple handlers or classes, with the control flow among fragments expressed only indirectly. We describe ResponderJ, an extension to Java supporting responders. A responder is simply a class with additional abilities, and these abilities interact naturally with the existing features of classes, including inheritance. We have implemented ResponderJ as an extension to the Polyglot compiler for Java. We illustrate ResponderJ’s utility in practice through two case studies: the implementation of a GUI supporting drag-and-drop functionality, and a re-implementation of the control logic of JDOM, a Java library for parsing and manipulating XML files.
KeywordsControl Logic Emit Statement Interactive Programming Interactive Application Event Handler
Unable to display preview. Download preview PDF.
- 1.Ada 95 reference manual, http://www.adahome.com/Resources/refs/rm95.html
- 2.Adya, A., Howell, J., Theimer, M., Bolosky, W., Douceur, J.: Cooperative task management without manual stack management. In: Proc. Usenix Tech. Conf. (2002)Google Scholar
- 3.Arnold, K., Gosling, J., Holmes, D.: The Java Programming Language, 3rd edn. Addison-Wesley, Reading (2000)Google Scholar
- 4.Cunningham, R., Kohler, E.: Making events less slippery with EEL. In: HotOS X: Hot Topics in Operating Systems (2005)Google Scholar
- 5.Dom home page, http://www.w3.org/DOM
- 6.Gamma, E., Helm, R., Johnson, R.E., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Massachusetts (1995)Google Scholar
- 7.Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, 2nd edn. The Java Series. Addison-Wesley, Boston (2000)Google Scholar
- 8.Jdom home page, http://www.jdom.org
- 14.Ousterhout, J.K.: Why threads are a bad idea (for most purposes). In: The 1996 USENIX Technical Conference (January 1996) (Invited talk)Google Scholar
- 15.PEP 255: Simple generators. http://www.python.org/peps/pep-0255.html
- 16.Sax home page, http://www.saxproject.org
- 17.Tarpenning, M.: Cooperative multitasking in C++. Dr. Dobb’s Journal, 16(4):54, 56, 58–59, 96, 98–99 (1991)Google Scholar