The design of a templating language to embed database queries into documents

المؤلف

Tuman, Sarah Husayn

المصدر

Journal of Education College

العدد

المجلد 2017، العدد 29 (31 ديسمبر/كانون الأول 2017)، ص ص. 511-534، 24ص.

الناشر

جامعة واسط كلية التربية

تاريخ النشر

2017-12-31

دولة النشر

العراق

عدد الصفحات

24

التخصصات الرئيسية

العلوم الهندسية والتكنولوجية (متداخلة التخصصات)

الملخص EN

Presenting information from a database to a human readership is one of the usual tasks in software development.

Commonly, an imperative language (such as: PHP, C#, Java, etc.) is used to query a database system and populate with the desired information the application's GUI, a web page or a printed report (referred from now on as Presentation Media).

Virtually all database systems are now capable to format, sort and group the data stored in a database, and last but not least to perform calculations against it.

These are most of the time enough to prepare the information that is going to be shown on screen or paper.

Thus it leaves just one role for the imperative code: to glue the query results to the Presentation Media.

This code tends to become repetitive and grows proportionally with the complexity of the Presentation Media.

The need for software developers to write this imperative code can be eliminated thought.

Instead, the markup code (HTML, LaTEX, etc) can have the ability to bind its elements directly to the database system.

To achieve this ability, I propose mixing the Presentation Media’s markup code with a Templating Language.

This paper elaborates the design of a Templating Language, a declarative language that adds annotations to any markup code regarding what data will be queried and how should it be integrated in document.

For this markup code to be consumed, there won't be necessary to implement any database query abilities in the process that renderers it.

Instead, a preprocessor will be invoked to interpret the Templating Language, connect to the database system and query the desired data, respectively to generate the final markup code.After analyzing several scenarios of GUIs and printed reports with a different range of presentation complexity, the design was aimed to handle from simple value insertions and markup code loops for multiple row results, to nested loops with interdependent queries, variables to share data between queries and automatic list numbering.

The data queries are specified in a subset of SQL, taking advantage of the data selection, formatting, grouping and sorting capabilities of database systems.

As most programming languages supports RegEx, to facilitate a faster implementation of the preprocessor, the Templating Language is parsed and validated using a RegEx set provided in this paper.

The method described in this paper simplifies the development and maintenance of a software by reducing the boilerplate code and adhering to the Separation of Concerns design principle, as the code will be organized in operational distinct layers (logic and presentation).

Also, it enhances teamwork by allowing a separation of work based on skill set, a designer being able for example to modify the structure of a data report without needing the intervention of a programmer too

نمط استشهاد جمعية علماء النفس الأمريكية (APA)

Tuman, Sarah Husayn. 2017. The design of a templating language to embed database queries into documents. Journal of Education College،Vol. 2017, no. 29, pp.511-534.
https://search.emarefa.net/detail/BIM-843287

نمط استشهاد الجمعية الأمريكية للغات الحديثة (MLA)

Tuman, Sarah Husayn. The design of a templating language to embed database queries into documents. Journal of Education College No. 29 (2017), pp.511-534.
https://search.emarefa.net/detail/BIM-843287

نمط استشهاد الجمعية الطبية الأمريكية (AMA)

Tuman, Sarah Husayn. The design of a templating language to embed database queries into documents. Journal of Education College. 2017. Vol. 2017, no. 29, pp.511-534.
https://search.emarefa.net/detail/BIM-843287

نوع البيانات

مقالات

لغة النص

الإنجليزية

رقم السجل

BIM-843287