Abstract
For the last decades text-based templates have been the primary option to build dynamic web pages. Until today, no other alternative has rebutted this approach. Yet, using text-based templates has several drawbacks including: 1. blocking resolution, 2. programming languages heterogeneity, 3. limited set of templating features and 4. opinionated idioms. In this paper we show how a domain specific language (DSL) for HTML (such as HtmlFlow, Kotlinx.html or React JSX) can suppress the text-based templates limitations and outperform state-of-the-art template engines (such as JSP, Handlebars, Thymeleaf, and others) in well known benchmarks. To that end, we use the Spring Framework and the sample application PetClinic to show how a DSL for HTML provides unopinionated web templates with boundless resolving features only ruled by the host programming language (such as Java, Kotlin or JavaScript).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Alur, D., Malks, D., Crupi, J.: Core J2EE Patterns: Best Practices and Design Strategies. Prentice Hall PTR, Upper Saddle River (2001)
Ase, D.: Kotlin DSL for HTML. Technical report (2015). https://j2html.com/
Baker, H.G.: Iterators: signs of weakness in object-oriented languages. SIGPLAN OOPS Messenger 4(3), 18–25 (1993). https://doi.org/10.1145/165507.165514
Binder, W., Hulaas, J., Moret, P.: Advanced Java bytecode instrumentation. In: Proceedings of the 5th International Symposium on Principles and Practice of Programming in Java, PPPJ 2007, pp. 135–144. ACM, New York (2007). https://doi.org/10.1145/1294325.1294344, http://doi.acm.org/10.1145/1294325.1294344
Bösecke, M.: JMH benchmark of the most popular Java template engines. Technical report (2015). https://github.com/mbosecke/template-benchmark
Breslav, A.: Kotlin Language Documentation (2016). https://kotlinlang.org/docs/kotlin-docs.pdf
Brogden, B., D’Cruz, C., Gaither, M.: Cocoon 2 Programming: Web Publishing with XML and Java. Wiley, Hoboken (2006)
Carvalho, F.M.: HtmlFlow Java DSL to write typesafe HTML. Technical report (2017). https://htmlflow.org/
Carvalho., F.M., Duarte., L.: Modern type-safe template engines (2018). https://dzone.com/articles/modern-type-safe-template-engines
Carvalho., F.M., Duarte., L.: HoT: unleash web views with higher-order templates. In: Proceedings of the 15th International Conference on Web Information Systems and Technologies - Volume 1: WEBIST, WEBIST 2019, pp. 118–129. INSTICC, SciTePress (2019). https://doi.org/10.5220/0008167701180129
Donald, K., Isvy, M., Leau, C.: Spring petclinic sample application. Technical report (2013). https://projects.spring.io/spring-petclinic/
Duarte., L., Carvalho., F.M.: xmlet. Technical report (2018). https://github.com/xmlet
Krasner, G.E., Pope, S.: A description of the model-view-controller user interface paradigm in the smalltalk80 system. J. Object Oriented Program. JOOP 1, 26–49 (1988)
Evans, E., Fowler, M.: Domain-driven Design: Tackling Complexity in the Heart of Software. Addison-Wesley (2004). https://books.google.pt/books?id=7dlaMs0SECsC
Fernández, D.: Thymeleaf. Technical report (2011). https://www.thymeleaf.org/
Fowler, M.: Patterns of Enterprise Application Architecture. Addison-Wesley Longman Publishing Co., Inc., Boston (2002)
Fowler, M.: Domain Specific Languages, 1st edn. Addison-Wesley Professional, Boston (2010)
Freeman, S., Mackinnon, T., Pryce, N., Talevi, M., Walnes, J.: Jmock library for test-driven development with mock objects. Technical report (2008). http://jmock.org
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Longman Publishing Co., Inc., Boston (1995)
Heijlsberg, A., Torgersen, M.: The.net standard query operators (2007)
Hors, A.L., et al.: Document object model (DOM) level 3 core specification. Technical report (2004). https://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/
Jin, X., Wah, B.W., Cheng, X., Wang, Y.: Significance and challenges of big data research. Big Data Res. 2(2), 59–64 (2015). https://doi.org/10.1016/j.bdr.2015.01.006
Johnson, R., et al.: The spring framework-reference documentation (2004). https://docs.spring.io/spring-framework/docs/3.2.x/spring-framework-reference/html/index.html
Landin, P.J.: Correspondence between ALGOL 60 and church’s lambda-notation: Part I. Commun. ACM 8(2), 89–101 (1965)
Landin, P.J.: The next 700 programming languages. Commun. ACM 9(3), 157–166 (1966)
Marx, S., Odersky, M., Buckley, A.: Jsr 14: Add generic types to the Java. Technical report, Java Community Process (2004). https://jcp.org/en/jsr/detail?id=14
Mashkov, S.: Kotlin DSL for HTML. Technical report (2015). https://github.com/Kotlin/kotlinx.html
Meijer, E.: Your mouse is a database. Queue 10(3), 20:20–20:33 (2012). https://doi.org/10.1145/2168796.2169076, http://doi.acm.org/10.1145/2168796.2169076
Mutschler III, E.O., Stefaniak, J.P.: Method for extending the hypertext markup language (HTML) to support enterprise application data binding, 17 August 1999. US Patent 5,940,075
Parker, H.: Opinionated analysis development. PeerJ Prepr. 5, e3210v1 (2017)
Parr, T.J.: Enforcing strict model-view separation in template engines. In: Proceedings of the 13th International Conference on World Wide Web, WWW 2004, pp. 224–233. ACM, New York (2004). https://doi.org/10.1145/988672.988703. http://doi.acm.org/10.1145/988672.988703
Reijn, J.: Comparing template engines for spring MVC. Technical report (2015). https://github.com/jreijn/spring-comparing-template-engines
Resig, J.: Pro JavaScript Techniques. Apress, New York (2007)
Singh, I., Johnson, M., Stearns, B.: Designing Enterprise Applications with the J2EE Platform. Addison-Wesley Professional, Boston (2002)
Ted, N.: Literary Machines. Mindful Press, Sausalito (1994)
Thompson, K.: Programming techniques: regular expression search algorithm. Commun. ACM 11(6), 419–422 (1968). https://doi.org/10.1145/363347.363387
Walke, J.: React Javascript library for building user interfaces. Technical report (2013). https://reactjs.org/
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Switzerland AG
About this paper
Cite this paper
Carvalho, F.M., Duarte, L., Gouesse, J. (2020). Text Web Templates Considered Harmful. In: Bozzon, A., Domínguez Mayo, F.J., Filipe, J. (eds) Web Information Systems and Technologies. WEBIST 2019. Lecture Notes in Business Information Processing, vol 399. Springer, Cham. https://doi.org/10.1007/978-3-030-61750-9_4
Download citation
DOI: https://doi.org/10.1007/978-3-030-61750-9_4
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-61749-3
Online ISBN: 978-3-030-61750-9
eBook Packages: Computer ScienceComputer Science (R0)