Abstract
The goal of domain-specific languages (DSLs) is to increase the productivity of software engineers by abstracting from low-level boilerplate code. Introduction of DSLs in the software development process requires a smooth workflow for the production of DSLs themselves. This requires technology for designing and implementing DSLs, but also a methodology for using that technology. That is, a collection of guidelines, design patterns, and reusable DSL components that show developers how to tackle common language design and implementation issues. This paper presents a case study in domain-specific language engineering. It reports on a project in which the author designed and built WebDSL, a DSL for web applications with a rich data model, using several DSLs for DSL engineering: SDF for syntax definition and Stratego/XT for code generation. The paper follows the stages in the development of the DSL. The contributions of the paper are three-fold. (1) A tutorial in the application of the specific SDF and Stratego/XT technology for building DSLs. (2) A description of an incremental DSL development process. (3) A domain-specific language for web-applications with rich data models. The paper concludes with a survey of related approaches.
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
Eclipse IDE Meta-tooling Platform (IMP), http://www.eclipse.org/proposals/imp/
Echo web framework (July 2007), http://echo.nextapp.com/site/echo2
Aho, A., Sethi, R., Ullman, J.: Compilers: Principles, techniques, and tools. Addison-Wesley, Reading (1986)
Atkins, D.L., Ball, T., Bruns, G., Cox, K.: Mawl: A domain-specific language for form-based services. IEEE Transactions on Software Engineering 25(3), 334–346 (1999)
Augusteijn, A.: Functional Programming, Program Transformations and Compiler Construction. PhD thesis, Department of Computing Science, Eindhoven University of Technology, The Netherlands (1993)
Baader, F., Nipkow, T.: Term Rewriting and All That. Cambridge University Press, Cambridge (1998)
Backus, J.W.: Automatic programming: properties and performance of FORTRAN systems I and II. In: Proceedings of the Symposium on the Mechanisation of Thought Processes, Teddington, Middlesex, England, The National Physical Laboratory (November 1958)
Backus, J.W., et al.: Report on the algorithmic language ALGOL 60. Communications of the ACM 3(5), 299–314 (1960)
Balat, V.: Ocsigen: ty** web interaction with objective Caml. In: Kennedy, A., Pottier, F. (eds.) Proceedings of the ACM Workshop on ML, Portland, Oregon, USA, pp. 84–94. ACM, New York (September 2006)
Bauer, C., King, G.: Java Persistence with Hibernate. In: Manning, Greenwhich, NY, USA (2007)
Beck, K.: Extreme Programming Explained. Addison-Wesley, Reading (2000)
Bentley, J.L.: Programming pearls: Little languages. Communications of the ACM 29(8), 711–721 (1986)
Brabrand, C., Møller, A., Ricky, M., Schwartzbach, M.I.: PowerForms: Declarative client-side form field validation. World Wide Web Journal 3(4), 205–314 (2000)
Brabrand, C., Möller, A., Schwartzbach, M.I.: The < bigwig > project. ACM Transactions on Internet Technology 2(2), 79–114 (2002)
Bravenboer, M.: Connecting XML processing and term rewriting with tree grammars. Master’s thesis, Utrecht University, Utrecht, The Netherlands (November 2003)
Bravenboer, M., Dolstra, E., Visser, E.: Preventing injection attacks with syntax embeddings. A host and guest language independent approach. In: Lawall, J. (ed.) Generative Programming and Component Engineering (GPCE 2007), pp. 3–12. ACM, New York (October 2007)
Bravenboer, M., Kalleberg, K.T., Vermaas, R., Visser, E.: Stratego/XT 0.16. Components for transformation systems. In: ACM SIGPLAN 2006 Workshop on Partial Evaluation and Program Manipulation (PEPM 2006), Charleston, South Carolina, pp. 95–99. ACM SIGPLAN, New York (January 2006)
Bravenboer, M., Kalleberg, K.T., Vermaas, R., Visser, E.: Stratego/XT Tutorial, Examples, and Reference Manual (latest). Department of Information and Computing Sciences, Universiteit Utrecht, Utrecht, The Netherlands (2006), http://www.strategoxt.org
Bravenboer, M., Kalleberg, K.T., Vermaas, R., Visser, E.: Stratego/XT 0.17. A language and toolset for program transformation. In: Science of Computer Programming (2008); Special issue on Experimental Systems and Tools
Bravenboer, M., van Dam, A., Olmos, K., Visser, E.: Program transformation with scoped dynamic rewrite rules. Fundamenta Informaticae 69(1–2), 123–178 (2006)
Bravenboer, M., Visser, E.: Concrete syntax for objects. Domain-specific language embedding and assimilation without restrictions. In: Schmidt, D.C. (ed.) Proceedings of the 19th ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications (OOPSLA 2004), Vancouver, Canada, pp. 365–383. ACM Press, New York (October 2004)
Bravenboer, M., Visser, E.: Designing syntax embeddings and assimilations for language libraries. In: Engels, G., Opdyke, B., Schmidt, D.C., Weil, F. (eds.) MODELS 2007. LNCS, vol. 4735. Springer, Heidelberg (2007)
Budinsky, F., Steinberg, D., Merks, E., Ellersick, R., Grose, T.J.: Eclipse Modeling Framework. Addison-Wesley, Reading (2004)
Chamberlin, D.D., Boyce, R.F.: SEQUEL: A structured english query language. In: Rustin, R. (ed.) Proceedings of 1974 ACM-SIGMOD Workshop on Data Description, Access and Control, Arbor, Michigan, pp. 249–264. ACM, New York (May 1974)
Christensen, A.S., Möller, A., Schwartzbach, M.I.: Extending Java for high-level web service construction. ACM Transactions on Programming Languages and Systems 25(6), 814–875 (2003)
Clinger, W.: Macros in scheme. SIGPLAN Lisp Pointers 4(4), 17–23 (1991)
Codd, E.F.: A relational model of data for large shared data banks. Communications of the ACM 13(6), 377–387 (1970)
Consel, C.: From a program family to a domain-specific language. In: Lengauer, C., Batory, D., Consel, C., Odersky, M. (eds.) Domain-Specific Program Generation. LNCS, vol. 3016, pp. 19–29. Springer, Heidelberg (2004)
Consel, C., Marlet, R.: Architecturing software using a methodology for language development. In: Palamidessi, C., Meinke, K., Glaser, H. (eds.) ALP 1998 and PLILP 1998. LNCS, vol. 1490, pp. 170–194. Springer, Heidelberg (1998)
Cook, S., Jones, G., Kent, S., Wills, A.C.: Domain-Specific Development with Visual Studio DSL Tools. Addison-Wesley, Reading (2007)
Cordy, J.: The TXL source transformation language. Science of Computer Programming 61(3), 190–210 (2006)
Czarnecki, K.: Overview of generative software development. In: Banâtre, J.-P., et al. (eds.) UPP 2004. LNCS, vol. 3566, pp. 313–328. Springer, Heidelberg (2005)
Czarnecki, K., Eisenecker, U.W.: Generative programming: methods, tools, and applications. Addison-Wesley, New York (2000)
Czarnecki, K., Helsen, S.: Feature-based survey of model transformation approaches. IBM Systems Journal 45(3), 621–646 (2006)
de Jonge, M.: A pretty-printer for every occasion. In: Ferguson, I., Gray, J., Scott, L. (eds.) Proceedings of the 2nd International Symposium on Constructing Software Engineering Tools (CoSET 2000). University of Wollongong, Australia (2000)
Dmitriev, S.: Language Oriented Programming: The next programming paradigm (2004), http://www.onboard.jetbrains.com/articles/04/10/lop/
Dolstra, E.: The Purely Functional Software Deployment Model. PhD thesis, Utrecht University, Utrecht, The Netherlands (January 2006)
Dolstra, E., Bravenboer, M., Visser, E.: Service configuration management. In: James Whitehead, J.E., Dahlqvist, A.P. (eds.) 12th International Workshop on Software Configuration Management (SCM-12), Lisbon, Portugal, pp. 83–98. ACM, New York (September 2005)
Dolstra, E., Visser, E., de Jonge, M.: Imposing a memory management discipline on software deployment. In: Estublier, J., Rosenblum, D. (eds.) 26th International Conference on Software Engineering (ICSE 2004), Edinburgh, Scotland, pp. 583–592. IEEE Computer Society, Los Alamitos (May 2004)
Ducasse, S., Lienhard, A., Renggli, L.: Seaside: A flexible environment for building dynamic web applications. IEEE Software, pp. 56–63 (September/ October 2007)
Earley, J.: An Efficient Context-free Parsing Algorithm. PhD thesis, Carnegie-Mellon University, Pittsburgh, PA (1968) (see also [42])
Earley, J.: An efficient context-free parsing algorithm. Communications of the ACM 13(2), 94–102 (1970)
Efftinge, S., Friese, P., Haase, A., Kadura, C., Kolb, B., Moroff, D., Thoms, K., Völter, M.: openArchitectureWare User Guide. Version 4.2 (2007), http://www.openarchitectureware.org
Ekman, T., Hedin, G.: Rewritable reference attributed grammars. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 144–169. Springer, Heidelberg (2004)
Ekman, T., Hedin, G.: The jastadd extensible java compiler. SIGPLAN Notices 42(10), 1–18 (2007)
Fowler, M.: Inversion of control containers and the dependency injection pattern (January 2004), http://www.martinfowler.com/articles/injection.html
Fowler, M.: Language workbenches: the killer-app for domain specific languages (2005), http://www.martinfowler.com/articles/languageWorkbench.html
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1995)
Gray, R.W., Heuring, V.P., Levi, S.P., Sloane, A.M., Waite, W.M.: Eli: A complete, flexible compiler construction system. Communications of the ACM 35, 121–131 (1992)
Gray, R.W., Levi, S.P., Heuring, V.P., Sloane, A.M., Waite, W.M.: Eli: a complete, flexible compiler construction system. Commun. ACM 35(2), 121–130 (1992)
Greenfield, J., Short, K.: Software Factories. Assembling Applications with Patterns, Models, Frameworks, and Tools. Wiley, Chichester (2004)
Groenewegen, D., Visser, E.: Declarative access control for WebDSL: Combining language integration and separation of concerns. In: Schwabe, D., Curbera, F. (eds.) International Conference on Web Engineering (ICWE 2008). IEEE CS Press, Los Alamitos (July 2008)
Heering, J., Hendriks, P.R.H., Klint, P., Rekers, J.: The syntax definition formalism SDF – reference manual. SIGPLAN Notices 24(11), 43–75 (1989)
Hemel, Z., Kats, L., Visser, E.: Code generation by model transformation. In: Vallecillo, A., Gray, J., Pierantonio, A. (eds.) ICMT 2008. LNCS, vol. 5063. Springer, Heidelberg (2008)
Hudak, P.: Building domain-specific embedded languages. ACM Comput. Surv. 28, 196 (1996)
Seam, J.: Seam - Contextual Components. A Framework for Java EE 5, 1.2.1.ga edition (2007), http://www.jboss.com/products/seam
Johnson, S.C.: YACC—yet another compiler-compiler. Technical Report CS-32, AT & T Bell Laboratories. Murray Hill, N.J (1975)
Kats, L., Bravenboer, M., Visser, E.: Mixing source and bytecode. A case for compilation by normalization. In: Kiczales, G. (ed.) Proceedings of the 23rd ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications (OOPSLA 2008). ACM Press, New York (2008)
Kats, L.C.L., Kalleberg, K.T., Visser, E.: Generating editors for embedded languages. integrating SGLR into IMP. In: Johnstone, A., Vinju, J. (eds.) Proceedings of the Eigth Workshop on Language Descriptions, Tools, and Applications (LDTA 2008), Budapest, Hungary (April 2008)
Kelly, S., Tolvanen, J.-P.: Domain-Specific Modeling. Enabling Full Code Generation. John Wiley & Sons, Inc, Chichester (2008)
Kent, S.: Model driven engineering. In: Butler, M., Petre, L., Sere, K. (eds.) IFM 2002. LNCS, vol. 2335, pp. 286–298. Springer, Heidelberg (2002)
Klint, P.: A meta-environment for generating programming environments. ACM Transactions on Software Engineering and Methodology 2(2), 176–201 (1993)
Knuth, D.E.: Backus Normal Form vs. Backus Naur Form. Communications of the ACM 7(12), 735–736 (1964)
Knuth, D.E.: On the translation of languages from left to right. Information and Control 8, 607–639 (1965)
Knuth, D.E.: Semantics of context-free languages. Mathematical Systems Theory 2(2), 127–145 (1968); Correction in: Mathematical Systems Theory 5(1), 95–96 (1971)
Knuth, D.E.: The TEXbook. vol. A, Computers and Typesetting. Addison-Wesley, Reading (1984)
Krishnamurthi, S., Hopkins, P.W., McCarthy, J.A., Graunke, P.T., Pettyjohn, G., Felleisen, M.: Implementation and use of the plt scheme web server. Higher-Order and Symbolic Computation 20(4), 431–460 (2007)
Lämmel, R., Visser, J.: Typed combinators for generic traversal. In: Krishnamurthi, S., Ramakrishnan, C.R. (eds.) PADL 2002. LNCS, vol. 2257, pp. 137–154. Springer, Heidelberg (2002)
Lamport, L.: LaTeX: A Documentation Preparation System. Addison-Wesley, Reading (1986)
Leijen, D., Meijer, E.: Domain specific embedded compilers. In: Proceedings of the 2nd conference on Domain-specific languages (DSL 1999), pp. 109–122. ACM Press, New York (1999)
Mak, S.: Develo** interacting domain specific languages. Master’s thesis, Utrecht University, Utrecht, The Netherlands, INF/SCR-07-20 (November 2007)
Mann, K.D.: JavaServer Faces in Action. Manning, Greenwhich, NY, USA (2005)
Mernik, M., Heering, J., Sloane, A.M.: When and how to develop domain-specific languages. ACM Computing Surveys 37(4), 316–344 (2005)
Nusairat, J.F.: Beginning JBoss Seam. Apress, New York (2007)
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)
OMG Architecture Board ORMSC. Model driven architecture. OMG document number ormsc/2001-07-01 (July 2001), www.omg.org
Parr, T.: The Definitive ANTLR Reference: Building Domain-Specific Languages by Terence Parr. The Pragmatic Programmers (2007)
Parr, T.J.: Enforcing strict model-view separation in template engines. In: WWW 2004: Proceedings of the 13th international conference on World Wide Web, pp. 224–233. ACM, New York (2004)
Peyton Jones, S.L. (ed.): Haskell98 Language and Libraries. The Revised Report. Cambridge University Press (2003)
Queinnec, C.: The influence of browsers on evaluators or, continuations to program web servers. In: International Conference on Functional Programming (ICFP 2000), pp. 23–33. ACM, New York (2000)
Reps, T., Teitelbaum, T.: The Synthesizer Generator: A System for Constructing Language-Based Editors. Springer, New York (1988)
Schmidt, D.C.: Model-driven engineering. IEEE Computer 39(2), 25–31 (2006)
Sheard, T., Peyton Jones, S.L.: Template metaprogramming for Haskell. In: Chakravarty, M.M.T. (ed.) ACM SIGPLAN Haskell Workshop 2002, pp. 1–16 (October 2002)
Simonyi, C., Christerson, M., Clifford, S.: Intentional software. In: Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications (OOPSLA 2006), pp. 451–464. ACM, New York (2006)
Spinellis, D.: Notable design patterns for domain specific languages. Journal of Systems and Software 56(1), 91–99 (2001)
Spinellis, D., Guruprasad, V.: Lightweight languages as software engineering tools. In: USENIX Conference on Domain-Specific Languages, , pp. 67–76. USENIX Association (October 1997)
Stahl, T., Völter, M.: Model-Driven Software Development. Wiley, Chichester (2005)
Steele Jr, G.L.: Growing a language. Higher-Order and Symbolic Computation 12, 221–236 (1998); (Text of invited talk at OOPSLA 1998)
Sturm, T., von Voss, J., Boger, M.: Generating code from uml with velocity templates. In: Jézéquel, J.-M., Hussmann, H., Cook, S. (eds.) UML 2002. LNCS, vol. 2460, pp. 150–161. Springer, Heidelberg (2002)
Sun Microsystems. JSR 220: Enterprise JavaBeansTM, Version 3.0. Java Persistence API (May 2, 2006)
Tharp, A.L.: The impact of fourth generation programming languages. SIGCSE Bull 16(2), 37–44 (1984)
Thiemann, P.: WASH/CGI: Server-side web scripting with sessions and typed, compositional forms. In: Krishnamurthi, S., Ramakrishnan, C.R. (eds.) PADL 2002. LNCS, vol. 2257, pp. 192–208. Springer, Heidelberg (2002)
Thomas, D., Hansson, D.H.: Agile Web Development with Rails. The Pragmatic Bookshelf (2005)
Tomita, M.: Efficient Parsing for Natural Languages. A Fast Algorithm for Practical Systems. Kluwer Academic Publishers, Dordrecht (1985)
Tratt, L.: Domain specific language implementation via compile-time meta-programming. ACM Transactions on Programming Languages and Systems (to appear, 2009)
van den Brand, M.G.J., de Jong, H., Klint, P., Olivier, P.: Efficient annotated terms. Software, Practice & Experience 30(3), 259–291 (2000)
van den Brand, M.G.J., Heering, J., Klint, P., Olivier, P.A.: Compiling language definitions: the ASF+SDF compiler. ACM Transactions on Programming Languages and Systems 24(4), 334–368 (2002)
van Deursen, A., Klint, P.: Little languages: Little maintenance? Journal of Software Maintenance 10(2), 75–92 (1998)
van Deursen, A., Klint, P., Visser, J.: Domain-specific languages: An annotated bibliography. SIGPLAN Notices 35(6), 26–36 (2000)
van Wijngaarden, J.: Code generation from a domain specific language. Designing and implementing complex program transformations. Master’s thesis, Utrecht University, Utrecht, The Netherlands, INF/SCR-03-29 (July 2003)
Visser, E.: Syntax Definition for Language Prototy**. PhD thesis, University of Amsterdam (September 1997)
Visser, E.: Meta-programming with concrete object syntax. In: Batory, D., Consel, C., Taha, W. (eds.) GPCE 2002. LNCS, vol. 2487, pp. 299–315. Springer, Heidelberg (2002)
Visser, E.: Program transformation with Stratego/XT: Rules, strategies, tools, and systems in StrategoXT-0.9. In: Lengauer, C., Batory, D., Consel, C., Odersky, M. (eds.) Domain-Specific Program Generation. LNCS, vol. 3016, pp. 216–238. Springer, Heidelberg (2004)
Visser, E.: A survey of strategies in rule-based program transformation systems. Journal of Symbolic Computation 40(1), 831–873 (2005); Special issue on Reduction Strategies in Rewriting and Programming
Visser, E., Benaissa, Z.-e.-A., Tolmach, A.: Building program optimizers with rewriting strategies. In: Proceedings of the third ACM SIGPLAN International Conference on Functional Programming (ICFP 1998), pp. 13–26. ACM Press, New York (1998)
W3C. Cascading Style Sheets, level 2. CSS2 Specification (May 1998), http://www.w3.org/TR/REC-CSS2/
Warmer, J.: A model driven software factory using domain specific languages. In: Akehurst, D.H., Vogel, R., Paige, R.F. (eds.) ECMDA-FA. LNCS, vol. 4530, pp. 194–203. Springer, Heidelberg (2007)
Wiedermann, B., Cook, W.R.: Extracting queries by static analysis of transparent persistence. In: Felleisen, M. (ed.) Proceedings of the 34th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2007), pp. 199–210. ACM, New York (2007)
Wyk, E.V., 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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2008 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Visser, E. (2008). WebDSL: A Case Study in Domain-Specific Language Engineering. In: Lämmel, R., Visser, J., Saraiva, J. (eds) Generative and Transformational Techniques in Software Engineering II. GTTSE 2007. Lecture Notes in Computer Science, vol 5235. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-88643-3_7
Download citation
DOI: https://doi.org/10.1007/978-3-540-88643-3_7
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-88642-6
Online ISBN: 978-3-540-88643-3
eBook Packages: Computer ScienceComputer Science (R0)