skip to main content
research-article

Generating reactive programs for graphical user interfaces from multi-way dataflow constraint systems

Published:26 October 2015Publication History
Skip Abstract Section

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.

References

  1. Adobe Flex. Free, open-source framework | Adobe Flex, Accessed June 2015. URL www.adobe.com/products/flex.html.Google ScholarGoogle Scholar
  2. Bacon. Bacon.js : Home, Accessed June 2015. URL baconjs.github.io.Google ScholarGoogle Scholar
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Courtney. Frappé: Functional reactive programming in Java. In Third International Symposium on Pratical Aspects of Declarative Languages (PADL), March 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle Scholar
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. J. Edwards. Subtext. ACM SIGPLAN Notices, 40(10):505, Oct. 2005. ISSN 03621340. doi: 10.1145 /1103845.1094851. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. C. Elliott and P. Hudak. Functional reactive animation. ACM SIGPLAN Notices, 32(8):263–273, Aug. 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. doi: 10.1145 /258949.Google ScholarGoogle Scholar
  10. 258973.Google ScholarGoogle Scholar
  11. 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 ScholarGoogle Scholar
  12. M. Fowler. Presentation Model Pattern, 2004. URL martinfowler.com/ eaaDev/PresentationModel.html.Google ScholarGoogle Scholar
  13. 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 ScholarGoogle Scholar
  14. HotDrink. Hotdrink, 2015. URL github.com/HotDrink/hotdrink. A JavaScript library for user interface programming.Google ScholarGoogle Scholar
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. doi: 10.1145 /1449913.1449927.Google ScholarGoogle Scholar
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. JavaFX. JavaFX — Oracle Documentation, Acessed June 2015. URL docs.oracle.com/javafx.Google ScholarGoogle Scholar
  20. Knockout. Knockout : Home, Accessed June 2015. URL knockoutjs. com.Google ScholarGoogle Scholar
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. Microsoft Rx. Reactive Extensions, Accessed June 2015. URL msdn.microsoft.com/en-us/data/gg577609.Google ScholarGoogle Scholar
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. OpenLaszlo. OpenLaszlo | the premier platform for rich internet applications, Accessed June 2015. URL www.openlaszlo.org.Google ScholarGoogle Scholar
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. doi: 10.1007 /3-540-46584-7_2.Google ScholarGoogle Scholar
  31. React. React: A JavaScript library for building user interfaces, Accessed June 2015. URL facebook.github.io/react.Google ScholarGoogle Scholar
  32. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  33. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  34. 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 ScholarGoogle Scholar
  35. G. Trombettoni and B. Neveu. Computational complexity of multiway, dataflow constraint problems. In IJCAI (1), pages 358–365, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  37. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Generating reactive programs for graphical user interfaces from multi-way dataflow constraint systems

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 51, Issue 3
      GPCE '15
      March 2016
      184 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2936314
      • Editor:
      • Andy Gill
      Issue’s Table of Contents
      • cover image ACM Conferences
        GPCE 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences
        October 2015
        184 pages
        ISBN:9781450336871
        DOI:10.1145/2814204

      Copyright © 2015 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 26 October 2015

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!