Exploring the Use of Code Generation Patterns for the Creation of Evolvable Documents and Runtime Artifacts Herwig Mannaert and Gilles Oorts Normalized Systems Institute University of Antwerp, Belgium Email: herwig.mannaert@uantwerp.be Koen De Cock and Peter Uhnak Research and Development NSX BVBA, Belgium Email: koen.de.cock@nsx.normalizedsystems.org Abstract—Many organizations are often required to produce large amounts of documents in various versions and variants. Though many solutions for document management and creation exist, the streamlined automatic generation of modular and evolvable documents remains challenging. It has been argued in previous work that a meta-circular metaprogramming archi- tecture enables a modular creation of source artifacts with very limited programming. In this contribution, a proof of concept is explored to generate modular LaTeX documents from runtime information systems through the use of a reduced version of this metaprogramming environment. The actual generation of several basic administrative document sources is explained, and it is argued that this architecture can easily be applied to generate other types of source artifacts using live runtime data. Index Terms—Evolvability; Normalized Systems Theory; Metaprogramming; Document Creation; Single Sourcing I. I NTRODUCTION Organizations are often required to produce large amounts of versions and variants of certain documents. While they have traditionally focused their efforts into streamlining technical product documentation [1], they are now also looking to build business value by creating personalized customer-faced docu- ments [2]. At the same time, current information systems are producing massive amounts of relatively simple documents, e.g., invoices and timesheets, based on corporate data. The streamlined and possibly automatic generation of such documents leads to concepts like modularization and single sourcing [1], both reminiscent of similar techniques used in the creation of software. Just like in software, dealing with versions and variants requires the design of document struc- tures that deplete the rippling of changes in order to provide a level of evolvability [3]. Moreover, the use of parameter data during the instantiation of document variants seems similar to the inner workings of code generation environments. In our previous work, we have presented a meta-circular implementation of a metaprogramming environment [4], and have argued that this architecture enables a scalable collab- oration between various metaprogramming projects featuring different meta-models [5][6]. In this contribution, we inves- tigate the use of a reduced version of this code generation environment within the generated software applications. More specifically, we explore the creation of evolvable artifacts, such as documents, where runtime data of the generated software application is used to instantiate the artifacts. The remainder of this paper is structured as follows. In Section II, we briefly discuss some aspects and terminology related to the creation and single sourcing of documents, an important class of artifacts created by information systems at runtime. In Section III-A, we explain the basic concept of Normalized Systems Theory with regard to the design of evolvable artifacts. Section III-B recapitulates the architec- ture of our meta-circular code generation environment, and explains that this expansion of source code artifacts is not limited to programming code. Section IV presents how the generation environment can be configured to instantiate and expand runtime artifacts such as documents using live data. Finally, we present some conclusions in Section V. II. MODULAR AND EVOLVABLE DOCUMENT CREATION While organizations have traditionally focused their efforts in document management into streamlining product docu- mentation [1], there is a widespread belief that personalized customer-faced documents can build business value by enhanc- ing customer loyalty [2]. However, repurposing internal docu- ments to be used for online purposes such as sales, marketing, product documentation and customer support has proven to be diffcult. Moreover, it is hard to find any best practices or repeatable models developed that address this challenge [1]. In this section, we briefly discuss some techniques and issues regarding the creation of evolvable documents. A. Document Creation and Single Sourcing A successful approach to handle any complex system or problem is modularization [7][8]. An example of such an approach in the area of document management is Component Content Management (CCM), defined as a set of methodolo- gies, processes, and technologies that rely on the principles of reuse, granularity, and structure to allow writers to author, review, and repurpose organizational content as small compo- nents [1]. One of the fundamental ideas of component content management is the separation of content and layout [9]. The granularity of a component in CCM is defined by the smallest unit of usable information [10]. Several standards exist that 17 Copyright (c) IARIA, 2021. ISBN: 978-1-61208-850-1 PATTERNS 2021 : The Thirteenth International Conference on Pervasive Patterns and Applications