Components.js: Semantic Dependency Injection
A common practice within object-oriented software is using composition to realize complex object behavior in a reusable way. Such compositions can be managed by Dependency Injection (DI), a popular technique in which components only depend on minimal interfaces and have their concrete dependencies passed into them. Instead of requiring program code, this separation enables describing the desired instantiations in declarative configuration files, such that objects can be wired together automatically at runtime. Configurations for existing DI frameworks typically only have local semantics, which limits their usage in other contexts. Yet some cases require configurations outside of their local scope, such as for the reproducibility of experiments, static program analysis, and semantic workflows. As such, there is a need for globally interoperable, addressable, and discoverable configurations, which can be achieved by leveraging Linked Data. We created Components.js as an open-source semantic DI framework for TypeScript and JavaScript applications, providing global semantics via Linked Data-based configuration files. In this article, we report on the Components.js framework by explaining its architecture and configuration, and discuss its impact by mentioning where and how applications use it. We show that Components.js is a stable framework that has seen significant uptake during the last couple of years. We recommend it for software projects that require high flexibility, configuration without code changes, sharing configurations with others, or applying these configurations in other contexts such as experimentation or static program analysis. We anticipate that Components.js will continue driving concrete research and development projects that require high degrees of customization to facilitate experimentation and testing, including the Comunica query engine and the Community Solid Server for decentralized data publication.
full text BibTeX other citation formats
Published in 2023 in Semantic Web Journal.
- dependency injection
- inversion of control
- RDF
- Linked Data
- Solid
- publication
- JavaScript
- research
Read this article online
- Read the full text online.
- Request a digital copy of this article.
- Comment on this article.
Cite this article in your work
Cite this article easily using its BibTeX entry:
@article{taelman_swj_2023,
title = {Components.js: Semantic Dependency Injection},
author = {Taelman, Ruben and Van Herwegen, Joachim and Vander Sande, Miel and Verborgh, Ruben},
journal = {Semantic Web Journal},
year = 2023,
volume = 14,
issue = 1,
pages = {135--153},
url = {https://content.iospress.com/articles/semantic-web/sw222945},
doi = {10.3233/SW-222945},
}
Alternatively, pick a reference of your choice below:
- ACM
- Ruben Taelman, Joachim Van Herwegen, Miel Vander Sande, and Ruben Verborgh. 2023. Components.js: Semantic Dependency Injection. Semantic Web Journal 14, 1 (2023), 135–153.
- APA
- Taelman, R., Van Herwegen, J., Vander Sande, M., & Verborgh, R. (2023). Components.js: Semantic Dependency Injection. Semantic Web Journal, 14(1), 135–153.
- IEEE
- R. Taelman, J. Van Herwegen, M. Vander Sande, and R. Verborgh, “Components.js: Semantic Dependency Injection,” Semantic Web Journal, vol. 14, no. 1, pp. 135–153, 2023.
- LNCS
- Taelman, R., Van Herwegen, J., Vander Sande, M., Verborgh, R.: Components.js: Semantic Dependency Injection. Semantic Web Journal. 14, 135–153 (2023).
- MLA
- Taelman, Ruben, et al. “Components.js: Semantic Dependency Injection.” Semantic Web Journal, vol. 14, no. 1, 2023, pp. 135–53.
Discuss this article
- Discover all publications by Ruben Verborgh.
- Find related articles on Google Scholar.
- Post your questions or comments below.