Abstract
For a GUI to remain responsive, it must be able to schedule lengthy tasks to be executed asynchronously. In the traditional approach to GUI implementation--writing functions to handle individual user events--asynchronous programming easily leads to defects. Ensuring that all data dependencies are respected is difficult when new events arrive while prior events are still being handled. Reactive programming techniques, gaining popularity in GUI programming, help since they make data dependencies explicit and enforce them automatically as variables' values change. However, data dependencies in GUIs usually change along with its state. Reactive programming must therefore describe a GUI as a collection of many reactive programs, whose interaction the programmer must explicitly coordinate. This paper presents a declarative approach for GUI programming that relieves the programmer from coordinating asynchronous computations. The approach is based on our prior work on "property models", where GUI state is maintained by a dataflow constraint system. A property model responds to user events by atomically constructing new data dependencies and scheduling asynchronous computations to enforce those dependencies. In essence, a property model dynamically generates a reactive program, adding to it as new events occur. The approach gives the following guarantee: the same sequence of events produces the same results, regardless of the timing of those events.
- Adobe Flex. Free, open-source framework | Adobe Flex, Accessed June 2015. URL www.adobe.com/products/flex.html.Google Scholar
- Bacon. Bacon.js : Home, Accessed June 2015. URL baconjs.github.io.Google Scholar
- A. Borning, R. Duisberg, B. Freeman-Benson, A. Kramer, and M. Woolf. Constraint hierarchies. SIGPLAN Not., 22(12):48–60, Dec. 1987. doi: 10.1145 /38807.38812. Google Scholar
Digital Library
- A. Courtney. Frappé: Functional reactive programming in Java. In Third International Symposium on Pratical Aspects of Declarative Languages (PADL), March 2001. Google Scholar
Digital Library
- A. Courtney and C. Elliott. Genuinely functional user interfaces. Haskell Workshop, pages 1–29, 2001. URL webdoc.sub.gwdg.de/ ebook/serien/ah/UU-CS/2001-62.pdf#page=47.Google Scholar
- A. Courtney, H. Nilsson, and J. Peterson. The Yampa arcade. In Proceedings of the ACM SIGPLAN workshop on Haskell — Haskell ’03, pages 7–18, New York, NY, USA, Aug. 2003. ACM Press. doi: 10.1145 /871895.871897. Google Scholar
Digital Library
- J. Edwards. Subtext. ACM SIGPLAN Notices, 40(10):505, Oct. 2005. ISSN 03621340. doi: 10.1145 /1103845.1094851. Google Scholar
Digital Library
- C. Elliott and P. Hudak. Functional reactive animation. ACM SIGPLAN Notices, 32(8):263–273, Aug. 1997. Google Scholar
Digital Library
- doi: 10.1145 /258949.Google Scholar
- 258973.Google Scholar
- T. Felgentre ff, A. Borning, and R. Hirschfeld. Specifying and solving constraints on object behavior. Journal of Object Technology, 13(4): 1:1–38, Sept. 2014. doi: 10.5381 /jot.2014.13.4.a1.Google Scholar
- M. Fowler. Presentation Model Pattern, 2004. URL martinfowler.com/ eaaDev/PresentationModel.html.Google Scholar
- J. Gossman. Introduction to Model /View/ViewModel pattern for building WPF apps, October 2005. URL blogs.msdn.com/b/ johngossman/archive/2005/10/08/478683.aspx.Google Scholar
- HotDrink. Hotdrink, 2015. URL github.com/HotDrink/hotdrink. A JavaScript library for user interface programming.Google Scholar
- J. Järvi, M. Marcus, S. Parent, J. Freeman, and J. N. Smith. Property models: from incidental algorithms to reusable components. In GPCE’08: Proc. of the 7th Int. Conf. on Generative programming and Component Engineering, pages 89–98, New York, NY, USA, 2008. Google Scholar
Digital Library
- doi: 10.1145 /1449913.1449927.Google Scholar
- J. Järvi, M. Marcus, S. Parent, J. Freeman, and J. N. Smith. Algorithms for user interfaces. In GPCE’09: Proc. of the 8th Int. Conf. on Generative programming and Component Engineering, pages 147–156, New York, NY, USA, 2009. ACM. doi: 10.1145 /1621607.1621630. Google Scholar
Digital Library
- J. Järvi, G. Foust, and M. Haveraaen. Specializing planners for hierarchical multi-way dataflow constraint systems. In Proc. of the 2014 Int. Conf. on Generative Programming: Concepts and Experiences, GPCE 2014, pages 1–10, New York, NY, USA, 2014. ACM. doi: 10.1145 /2658761.2658762. Google Scholar
Digital Library
- JavaFX. JavaFX — Oracle Documentation, Acessed June 2015. URL docs.oracle.com/javafx.Google Scholar
- Knockout. Knockout : Home, Accessed June 2015. URL knockoutjs. com.Google Scholar
- G. E. Krasner and S. T. Pope. A cookbook for using the model-viewcontroller user interface paradigm in Smalltalk-80. Journal of Object Oriented Programming, 1(3):26–49, 1988. Google Scholar
Digital Library
- B. Liskov and L. Shrira. Promises: linguistic support for e fficient asynchronous procedure calls in distributed systems. ACM SIGPLAN Notices, 23(7):260–267, July 1988. doi: 10.1145 /960116.54016. Google Scholar
Digital Library
- Microsoft Rx. Reactive Extensions, Accessed June 2015. URL msdn.microsoft.com/en-us/data/gg577609.Google Scholar
- B. Myers, D. Giuse, R. Dannenberg, B. Zanden, D. Kosbie, E. Pervin, A. Mickish, and P. Marchal. Garnet: Comprehensive support for graphical, highly interactive user interfaces. Computer, 23(11):71–85, Nov. 1990. Google Scholar
Digital Library
- B. A. Myers. Separating application code from toolkits: eliminating the spaghetti of call-backs. In Proc. of the 4th annual ACM symp. on User Interface Software and Technology, UIST ’91, pages 211–220, New York, NY, USA, 1991. ACM. doi: 10.1145 /120782.120805. Google Scholar
Digital Library
- B. A. Myers, R. G. McDaniel, R. C. Miller, A. S. Ferrency, A. Faulring, B. D. Kyle, A. Mickish, A. Klimovitski, and P. Doane. The Amulet environment: New models for e ffective user interface software development. Software Engineering, 23(6):347–365, 1997. Google Scholar
Digital Library
- S. Oney, B. Myers, and J. Brandt. ConstraintJS: programming interactive behaviors for the web by integrating constraints and states. In Proceedings of the 25th annual ACM symposium on User Interface Software and Technology, UIST ’12, pages 229–238, New York, NY, USA, 2012. ACM. doi: 10.1145 /2380116.2380146. Google Scholar
Digital Library
- OpenLaszlo. OpenLaszlo | the premier platform for rich internet applications, Accessed June 2015. URL www.openlaszlo.org.Google Scholar
- J. Peterson, V. Trifonov, and A. Serjantov. Parallel functional reactive programming. In E. Pontelli and V. Santos Costa, editors, Practical Aspects of Declarative Languages, volume 1753 of Lecture Notes in Computer Science, pages 16–31. Springer Berlin Heidelberg, 2000. Google Scholar
Digital Library
- doi: 10.1007 /3-540-46584-7_2.Google Scholar
- React. React: A JavaScript library for building user interfaces, Accessed June 2015. URL facebook.github.io/react.Google Scholar
- M. Sage. FranTk — a declarative GUI language for Haskell. In Proc. of the fifth ACM SIGPLAN Int. Conf. on Functional programming — ICFP ’00, volume 35, pages 106–117, New York, NY, USA, Sept. 2000. ACM Press. doi: 10.1145 /351240.351250. Google Scholar
Digital Library
- M. Sannella. Skyblue: A multi-way local propagation constraint solver for user interface construction. In UIST ’94: Proceedings of the 7th annual ACM symposium on User Interface Software and Technology, pages 137–146, New York, NY, USA, 1994. ACM. Google Scholar
Digital Library
- M. Sannella and A. H. Borning. Multi-Garnet: Integrating multi-way constraints with garnet. Technical Report 92-07-01, University of Washington, Department of Computer Science and Engineering, 1992.Google Scholar
- G. Trombettoni and B. Neveu. Computational complexity of multiway, dataflow constraint problems. In IJCAI (1), pages 358–365, 1997. Google Scholar
Digital Library
- B. Vander Zanden. An incremental algorithm for satisfying hierarchies of multiway dataflow constraints. ACM Trans. Program. Lang. Syst., 18(1):30–72, Jan. 1996. doi: 10.1145 /225540.225543. Google Scholar
Digital Library
- Z. Wan and P. Hudak. Functional reactive programming from first principles. ACM SIGPLAN Notices, 35(5):242–252, May 2000. doi: 10.1145 /358438.349331. Google Scholar
Digital Library
Index Terms
Generating reactive programs for graphical user interfaces from multi-way dataflow constraint systems
Recommendations
Generating reactive programs for graphical user interfaces from multi-way dataflow constraint systems
GPCE 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Generative Programming: Concepts and ExperiencesFor a GUI to remain responsive, it must be able to schedule lengthy tasks to be executed asynchronously. In the traditional approach to GUI implementation--writing functions to handle individual user events--asynchronous programming easily leads to ...
Specializing planners for hierarchical multi-way dataflow constraint systems
GPCE '14A constraint system consists of variables and a set of constraints on those variables. To solve a constraint system is to find a valuation that satisfies all constraints; or the "best" subset of constraints if not all can simultaneously be satisfied. ...
Specializing planners for hierarchical multi-way dataflow constraint systems
GPCE 2014: Proceedings of the 2014 International Conference on Generative Programming: Concepts and ExperiencesA constraint system consists of variables and a set of constraints on those variables. To solve a constraint system is to find a valuation that satisfies all constraints; or the "best" subset of constraints if not all can simultaneously be satisfied. ...






Comments