From Visual Model to Source Code: Automated Fluent API Development Using Template-Based Code Generation in DSL Tools

The fluent API, also known as Internal DSL, is one of the concepts introduced primarily for the purpose of increasing readability and maintainability in the process of software development. It is most commonly used when there is a need to perform operations according to precisely defined rules that determine their possible orders. However, implementing a Fluent API by manual coding can divert focus from defining these rules toward technical implementation, increasing the risk of errors, unexpected behavior, and higher development costs. To address these challenges, a model-driven engineering (MDE) approach can be applied, enabling the visual design of the Fluent API model and its transformation into a code skeleton.This paper aims to present how the previously created graphical development tool, implemented as a Microsoft Visual Studio extension for modeling Fluent API, can be enhanced with model-to-text transformation in order to provide code generation of a fluent API structure. That objective is achieved by using the template-based code generation technique, implemented by enabling the execution of the appropriate T4 text templates. The proposed approach is validated by demonstrating a real-life fluent API example's code generation from its model, resulting in C# source files that contain classes, interfaces, and their corresponding methods.

Authors

Institutions

Publication Details

Published
2025-03-19
DOI
https://doi.org/10.1109/infoteh64129.2025.10959264
Primary Topic
Web Applications and Data Management
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

From Visual Model to Source Code: Automated Fluent API Development Using Template-Based Code Generation in DSL Tools

Vladimir Vujović, Sava Čavoški, Snježana Milinković, Milica Vuković et al.
Web Applications and Data Management
article

From Visual Model to Source Code: Automated Fluent API Development Using Template-Based Code Generation in DSL Tools

Vladimir Vujović, Sava Čavoški, Snježana Milinković, Milica Vuković, Zorana Štaka
article en

Abstract

The fluent API, also known as Internal DSL, is one of the concepts introduced primarily for the purpose of increasing readability and maintainability in the process of software development. It is most commonly used when there is a need to perform operations according to precisely defined rules that determine their possible orders. However, implementing a Fluent API by manual coding can divert focus from defining these rules toward technical implementation, increasing the risk of errors, unexpected behavior, and higher development costs. To address these challenges, a model-driven engineering (MDE) approach can be applied, enabling the visual design of the Fluent API model and its transformation into a code skeleton.This paper aims to present how the previously created graphical development tool, implemented as a Microsoft Visual Studio extension for modeling Fluent API, can be enhanced with model-to-text transformation in order to provide code generation of a fluent API structure. That objective is achieved by using the template-based code generation technique, implemented by enabling the execution of the appropriate T4 text templates. The proposed approach is validated by demonstrating a real-life fluent API example's code generation from its model, resulting in C# source files that contain classes, interfaces, and their corresponding methods.

University of East Sarajevo (BA), Union University (RS)
Quality Education
Openalex Percentile: Top 91%
Web Applications and Data Management
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

From Visual Model to Source Code: Automated Fluent API Development Using Template-Based Code Generation in DSL Tools — Vladimir Vujović, Sava Čavoški, et al. · (2025) | TGRS Research Map | TGRS