Abstract
Domain-specific languages (DSLs) can improve software maintainability due to less verbose syntax, avoidance of boilerplate code, more accurate static analysis, and domain-specific tool support. However, most existing applications cannot capitalise on these benefits because they were not designed to use DSLs, and rewriting large existing applications from scratch is infeasible. We propose a process for evolving existing software to use embedded DSLs based on modular definitions and applications of syntactic sugar as provided by the extensible programming language SugarJ. Our process is incremental along two dimensions: A developer can add support for another DSL as library, and a developer can refactor more code to use the syntax, static analysis, and tooling of a DSL. Importantly, the application remains executable at all times and no complete rewrite is necessary. We evaluate our process by incrementally evolving the Java Pet Store and a deliberately small part of the Eclipse IDE to use language support for field-accessors, JPQL, XML, and XML Schema. To help maintainers to locate Java code that would benefit from using DSLs, we developed a tool that analyses the definition of a DSL to derive patterns of Java code that could be represented with a high-level abstraction of the DSL instead.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Bachrach, J., Playford, K.: The Java syntactic extender (JSE). In: OOPSLA, pp. 31–42. ACM (2001)
Batory, D., Johnson, C., MacDonald, B., von Heeder, D.: Achieving extensibility through product-lines and domain-specific languages: A case study. TOSEM 11(2), 191–214 (2002)
Bennett, K.H., Rajlich, V.T.: Software maintenance and evolution: A roadmap. In: FOSE, pp. 73–87. ACM (2000)
Bianchi, A., Caivano, D., Marengo, V., Visaggio, G.: Iterative reengineering of legacy systems. Transactions on Software Engineering (TSE) 29(3), 225–241 (2003)
Brabrand, C., Schwartzbach, M.I.: Growing languages with metamorphic syntax macros. In: PEPM, pp. 31–40. ACM (2002)
Dmitriev, S.: Language oriented programming: The next programming paradigm (2004)
Ekman, T., Hedin, G.: The JastAdd extensible Java compiler. In: OOPSLA, pp. 1–18. ACM (2007)
Erdweg, S.: Extensible Languages for Flexible and Principled Domain Abstraction. PhD thesis, Philipps-Universiät Marburg (2013)
Erdweg, S., Giarrusso, P.G., Rendel, T.: Language composition untangled. In: LDTA, pp. 7:1–7:8. ACM (2012)
Erdweg, S., Kats, L.C.L., Rendel, T., Kästner, C., Ostermann, K., Visser, E.: Growing a language environment with editor libraries. In: GPCE, pp. 167–176. ACM (2011)
Erdweg, S., Rendel, T., Kästner, C., Ostermann, K.: SugarJ: Library-based syntactic language extensibility. In: OOPSLA, pp. 391–406. ACM (2011)
Erdweg, S., et al.: The state of the art in language workbenches. In: Erwig, M., Paige, R.F., Van Wyk, E. (eds.) SLE 2013. LNCS, vol. 8225, pp. 197–217. Springer, Heidelberg (2013)
Flyvbjerg, B.: Five misunderstandings about case-study research. Qualitative Inquiry, 219–245 (2006)
Fowler, M.: Language workbenches: The killer-app for domain specific languages (2005), http://martinfowler.com/articles/languageWorkbench.html
Germán, D.M., Davies, J.: Apples vs. oranges?: An exploration of the challenges of comparing the source code of two software systems. In: MSR, pp. 246–249. IEEE (2011)
Gil, J., Lenz, K.: Simple and safe SQL queries with C++ templates. Science of Computer Programming 75(7), 573–595 (2010)
Hudak, P.: Modular domain specific languages and tools. In: Proceedings of International Conference on Software Reuse (ICSR), pp. 134–142. IEEE (1998)
Kats, L.C.L., Visser, E.: The Spoofax language workbench: Rules for declarative specification of languages and IDEs. In: OOPSLA, pp. 444–463. ACM (2010)
Nystrom, N., Clarkson, M.R., Myers, A.C.: Polyglot: An extensible compiler framework for java. In: Hedin, G. (ed.) CC 2003. LNCS, vol. 2622, pp. 138–152. Springer, Heidelberg (2003)
Sneed, H.M.: Planning the reengineering of legacy systems. IEEE Software 12(1), 24–34 (1995)
Steele Jr., G.L.: Growing a language. Higher-Order and Symbolic Computation 12(3), 221–236 (1999)
Sun Microsystems. Java Pet Store (2002), http://www.oracle.com/technetwork/java/index-136650.html (accessed November 14, 2012)
van Deursen, A., Klint, P.: Little languages: Little maintenance? Software Maintenance 10(2), 75–92 (1998)
Van Wyk, E., Krishnan, L., Bodin, D., Schwerdfeger, A.: Attribute grammar-based language extensions for java. In: Ernst, E. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 575–599. Springer, Heidelberg (2007)
Visser, E.: Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam (1997)
Visser, E.: Meta-programming with concrete object syntax. In: Batory, D., Blum, A., Taha, W. (eds.) GPCE 2002. LNCS, vol. 2487, pp. 299–315. Springer, Heidelberg (2002)
Visser, E., Benaissa, Z.-E.-A.: A core language for rewriting. Electronic Notes in Theoretical Computer Science 15, 422–441 (1998)
Visser, E., Benaissa, Z.-E.-A., Tolmach, A.P.: Building program optimizers with rewriting strategies. In: ICFP, pp. 13–26. ACM (1998)
Ward, M.P.: Language-oriented programming. Software – Concepts and Tools 15, 147–161 (1995)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer International Publishing Switzerland
About this paper
Cite this paper
Fehrenbach, S., Erdweg, S., Ostermann, K. (2013). Software Evolution to Domain-Specific Languages. In: Erwig, M., Paige, R.F., Van Wyk, E. (eds) Software Language Engineering. SLE 2013. Lecture Notes in Computer Science, vol 8225. Springer, Cham. https://doi.org/10.1007/978-3-319-02654-1_6
Download citation
DOI: https://doi.org/10.1007/978-3-319-02654-1_6
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-02653-4
Online ISBN: 978-3-319-02654-1
eBook Packages: Computer ScienceComputer Science (R0)