<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>DepIn-O: An Ontology on Dependency Injection Software Frameworks</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Cleisson S. Guterres</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Camila Z. de Aguiar</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vítor E. S. Souza</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Ontology &amp; Conceptual Modeling Research Group (NEMO), Universidade Federal do Espirito Santo (UFES)</institution>
          ,
          <addr-line>Brasil Av. Fernando Ferrari, 514 - Goiabeiras - Vitória, ES - 29075-910</addr-line>
        </aff>
      </contrib-group>
      <fpage>51</fpage>
      <lpage>64</lpage>
      <abstract>
        <p>Dependency Injection (DI) is a state-of-practice design pattern utilized for implementing inversion of control, with various DI frameworks widely adopted in many object-oriented programming languages. However, to the best of our knowledge, a formal definition of the associated terminologies within these frameworks has yet to be established. This lack of standardization can make it challenging to achieve semantic interoperability goals, such as code migration between diferent frameworks or identification of architectural issues regardless of the specific framework in use. To tackle this challenge, we propose DepIn-O, a domain reference ontology designed to capture and express the semantic concepts associated with DI within software development.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Dependency Injection</kwd>
        <kwd>Ontology</kwd>
        <kwd>Ontology Engineering</kwd>
        <kwd>DepIn-O</kwd>
        <kwd>SABiOx</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Dependency Injection (DI) frameworks are extremely useful and popular tools to facilitate the
implementation of DI patterns across multiple object-oriented (OO) programming languages,
and their usage is state-of-the-practice. Despite these facts, to the best of our knowledge, there
are no proposals in the literature that provide a formalization of the DI concepts employed in
frameworks, required to pave the way for the automation of semantic interoperability tasks,
such as, e.g., detection of code smells — pieces of code that signal a bad programming practice
and warrant further inspection [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] — or code migration.
      </p>
      <p>
        To change that scenario, we introduce the Dependency Injection Ontology (DepIn-O), an
ontology with the goal of representing the fundamental semantic concepts associated with
the DI domain. Our ontology was developed following the SABiOx method [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], built upon the
foundation laid out by UFO [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], specialized concepts provided by OOC-O [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] and modeled using
OntoUML [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Its evaluation was performed through verification — answering the competency
questions raised when eliciting the requirements — and validation — mapping the ontology
concepts to instances within some of the most popular DI frameworks currently available.
      </p>
      <p>The remaining sections of this paper are organized as follows: Section 2 summarizes the
baseline on Dependency Injection and its frameworks, Ontology Engineering, and foundational
and domain ontologies used as a basis for the construction of DepIn-O; Section 3 presents our
ontology; Section 4 describes the evaluation of DepIn-O through verification, validation and an
application; Section 5 compares our work with related works; and Section 6 presents our final
considerations and discusses future possibilities. All supplementary material mentioned in this
paper is available at https://nemo.inf.ufes.br/en/projetos/sfwon/.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Baseline</title>
      <p>In this section, we summarize the baseline of our work: Dependency Injection and its supporting
frameworks, and the ontological foundations of DepIn-O.</p>
      <sec id="sec-2-1">
        <title>2.1. Dependency Injection</title>
        <p>
          Dependency Injection (DI) is a set of software design patterns that enable the development of
loosely coupled code. It encompasses three main principles: Composition, Lifetime Management,
and Specification &amp; Interception [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ].
        </p>
        <p>
          Composition states that objects must receive their dependencies externally instead of creating
them internally [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. A dependency is a piece of code essential for a diferent part of the code to
work [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. The receiver of a dependency is referred to as its consumer. Composition provides
the foundation of DI and paves the way for the other two principles. Listing 1 exemplifies a
Composition.
        </p>
        <p>Listing 1: DI Composition example in Java.
1 public interface DependencyA { }
2
3 public c l a s s ConsumerCI {
45 DependencyA dep ;
867 p}ubldicepC=onssuemrveircCeI (; DependencyA service ) {
9 }</p>
        <p>/ / receives external dependency</p>
        <p>Composition removes from the consumer the knowledge of how its dependencies are
implemented. To benefit from it, we should supply our consumers with abstract dependencies, as
done in Listing 1, and later specify a concrete implementation of said dependency. That way, we
gain flexibility, as dependencies can be easily swapped out — in case of migration — or mocked
for unit testing. As a direct consequence, we can apply the interception pattern by employing
decorators: a class that can use the original dependency as its consumer and be used by the
original consumer as its dependency, as exemplified in Listing 2.</p>
        <p>Listing 2: Decorator example in Java.
1 / / DecoratorA i s an implementation of DependencyA
342 publDicepec nlades nscyDAecdoerpat;orA implements DependencyA {
7865 p}//ubldDiceepcDo=reactsooerrarAtvoirciAes (; DalespoendaencocynAsumseerrvoicfe D){ependencyA
9 }
10
11 public c l a s s DependencyImpl implements DependencyA { }
12
13 / / l a t e r usage and instantiation</p>
        <p>Composition also removes from the consumer the responsibility over the lifetime management
of its dependencies, thus allowing the developer to define when to share the same instance
of a dependency between diferent consumers and when to provide a diferent instance to
a consumer. This is exemplified in Listing 3, as serviceX is shared between consumerA and
consumerB, while serviceY is only provided to consumerC.</p>
        <sec id="sec-2-1-1">
          <title>Listing 3: Dependency shared between diferent Consumers in Java.</title>
          <p>1 DependencyImpl serviceX = new DependencyImpl ( ) ;
2 DependencyImpl serviceY = new DependencyImpl ( ) ;
3 ConsumerCI consumerA = new ConsumerCI ( serviceX ) ;
4 ConsumerCI consumerB = new ConsumerCI ( serviceX ) ;
5 ConsumerCI consumerC = new ConsumerCI ( serviceY ) ;</p>
          <p>
            Assuming a good understanding of DI’s underlying principles, frameworks become extremely
valuable tools to streamline the implementation of DI patterns across multiple object-oriented
(OO) programming languages. A software framework generally provides a skeletal abstraction of
a solution to a number of problems that have some similarities [
            <xref ref-type="bibr" rid="ref9">9</xref>
            ]. A DI framework is a software
library that either explicitly or implicitly provides an Injector that automates many of the
tasks involved in Object Composition, Specification &amp; Interception, and Lifetime Management,
constructing and resolving object graphs [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ].
          </p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. Ontological Foundations</title>
        <p>
          The fact that DI patterns are applicable to any OO language and are supported by numerous
frameworks stumbles on a well-known issue: the problem of Semantic Interoperability, i.e.,
combining independently conceived information spaces and providing unified analytics over
them. Ontologies tackle that challenge, as they aim to produce concrete representation models
of conceptualizations of reality that are consistent and facilitate interoperability [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]. This is
our motivation to build an ontology on DI.
        </p>
        <p>
          The use of an Ontology Engineering method can help improve the quality of the process
and, thus, the quality of the results. The SABiO method [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] has been successfully used for
developing several ontologies in the Software Engineering domain (e.g., [
          <xref ref-type="bibr" rid="ref12 ref13">12, 13</xref>
          ]), given its
focus on the development of domain ontologies. More recently, however, SABiOx [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] has been
proposed as an extension of SABiO, incorporating agile principles and providing more details
on the activities that compose its process in order to help guide the ontology engineer. For these
reasons, it was chosen as our Ontology Engineering method for the construction of DepIn-O.
        </p>
        <p>
          As proposed by SABiOx, we defined a Foundational Ontology to be the basis of our work. We
chose the Unified Foundational Ontology (UFO) due to its notable capacity to provide conceptual
clarification in complex domains. In particular, we employed UFO-A, an ontology of endurants
that deals with aspects of structural conceptual modeling [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ].
        </p>
        <p>
          Another procedure of SABiOx is choosing a Modeling Language. We opted for OntoUML, an
extension of the Unified Modeling Language (UML) based on UFO that incorporates principles
from Ontology and Logic Based Modeling to provide a rigorous, expressive, and rich set of
modeling constructs for representing diferent types of entities and relationships. [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] To ensure
conformity to it, we utilized the OntoUML plugin for Visual Paradigm1 to model our ontology.
        </p>
        <p>
          SABiOx also suggests reusing related Domain Ontologies, if possible. Since Dependency
Injection is a subdomain of Object-Oriented Programming, we found that the Object-Oriented
Code Ontology (OOC-O) provides substantial support for the notions presented in DepIn-O.
OOC-O is a Domain Ontology that identifies and represents the semantics of the entities present
at compile time in object-oriented code [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]. Figure 1 presents a fragment of OOC-O referenced
and reused by our ontology.
        </p>
        <p>In OOC-O, every Class must be either a Concrete Class, which is fully implemented and
can have instances, or an Abstract Class, which is an incompletely implemented class used as a
basis for its descendants. A Member is a component of a class, such as an Attribute (Member
Variable), which is a Variable that is also a Member; or a Method (Member Function), a
function that defines the behavior of an object. An Instance Method is a specialization of
Method that operates only on objects of its Class; the Constructor Method is a specialization
of Instance Method that specifies the process of creating and initializing an object. An Instance
Variable is an Attribute that delineates characteristics of an object in the context of a specific
instance of its root Class. A Class assumes the role of a Superclass when its instance variables
and methods are provided by Inheritance to another Class, defined as Subclass.</p>
        <p>In the next sections, to make explicit the references to OOC-O concepts in the text, we use a
prefix, e.g., “OOC-O Instance Method”, rather than just “Instance Method”.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. DepIn-O: a Dependency Injection Ontology</title>
      <p>The main purpose of DepIn-O is to represent the fundamental conceptual features associated
with the Dependency Injection domain in a unified and consensual manner across various
programming languages and frameworks.</p>
      <p>We conducted an analysis of frameworks developed for the top three most used OO
Programming Languages according to the 2022 Stack Overflow Developer Survey: Java, C#, and
Python [14]. This survey was chosen due to its popularity among the software development
community. The selected frameworks were Dependency Injector for Python; CDI and Spring
for Java; Autofac and Simple Injector for C#.</p>
      <p>Following SABiOx, we delimited our focus in the vertical dimension to the level of design-time
constructs, without delving into the perspective of runtime; and in the horizontal dimension
to include concepts associated with the main DI principles listed in Section 2.1, provided that
they were present in two or more of the examined frameworks. The result is documented as
DepIn-O’s Catalog of Concepts and is available as supplementary material.</p>
      <p>SABiOx suggests the elaboration of Competency Questions (CQs) to elicit the functional
requirements of an Ontology. Table 1 presents these questions for DepIn-O.</p>
      <p>To facilitate comprehension, maintenance, and future reutilization, SABiOx proposes
partitioning an Ontology into modules in conformity with previously identified subdomains. We
divided DepIn-O into modules according to the main principles of DI previously discussed —
Composition (DepIn-O: Composition), Specification &amp; Interception ( DepIn-O: Specification ) and
Lifetime Management (DepIn-O: Scopes). Their relationships to each other and to OOC-O are
shown in Figure 2 and, in what follows, we detail each partition of the ontology. The original
stereotype-based color scheme from the OntoUML plugin was altered in the figures in favor
of a module-based color scheme to facilitate the visualization of the relationships between the
modules. The complete (unpartitioned) view of DepIn-O is also available as supplementary
material.</p>
      <sec id="sec-3-1">
        <title>3.1. DepIn-O: Composition Module</title>
        <p>When assuming the role of an Injection Point, an OOC-O Constructor Method is defined as a
Constructor Injection Point, while a non-Constructor OOC-O Instance Method is defined as
a Method Injection Point — this separation is particularly significant, as frameworks typically
handle constructors diferently from non-constructors when wiring DI compositions. When an
OOC-O Instance Variable is an Injection Point, it is called a Property Injection Point. Since
OOC-O Instance Method and OOC-O Instance Variable inherit diferent identity principles
(cf. Figure 1) an Injection Point is a RoleMixin, an abstract generalization set that aggregates
concrete elements of distinct identity principles that fit the same role. It is also important to
note that the roles that specialize Injection Point are characterized by the relation of the latter
with Dependency Injection, which they inherit.</p>
        <p>As general rules, a Consumer can have multiple Injection Points and an Injection Point can
set up multiple Dependency Injections; we employ axioms to describe the exceptions to these
rules, namely: a Consumer can only have one Constructor Injection Point; a Property Injection
Point can only invoke one Dependency Injection. As mentioned before, there is no restriction
on how many Consumers can share the same Dependency, so a Dependency can also be injected
by multiple Dependency Injections. Still, every Dependency Injection is unique between one</p>
        <sec id="sec-3-1-1">
          <title>Dependency and one Injection Point from one Consumer.</title>
        </sec>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. DepIn-O: Specification Module</title>
        <p>Figure 4 presents the OntoUML diagram of the DepIn-O Specification Module. We define a
Dependency that specializes OOC-O Concrete Class as a Concrete Dependency. In
contrast, an Abstract Dependency specializes not only OOC-O Abstract Class but also OOC-O
Superclass, since it requires at least one implementation to be provided to resolve it. This
implementation must be a Concrete Dependency that also specializes OOC-O Subclass, as it is
linked to the Abstract Dependency through the OOC-O Inheritance relator, and we refer to it
as a Dependency Implementation. As with the previous module, the roles that specialize
Dependency are characterized by the relation of the latter with Dependency Injection.</p>
        <p>An important observation arises from the fact that while OOC-O supports the concept
of multiple inheritance, DepIn-O does not, as a Dependency Implementation is restricted to
inheriting from only one Abstract Dependency. However, there is no upper limit on the number
of implementations that can be provided for one Abstract Dependency. Consequently, the
existence of multiple Dependency Implementations for the same Abstract Dependency raises a
question regarding the determination of the specific implementation that will be invoked to
resolve a call to an Abstract Dependency.</p>
        <p>A Dependency Implementation becomes a Primary Dependency when it resolves the
Abstract Dependency by default. On the other hand, when a Dependency Injection demands the
existence of a Dependency Specification to call for a specific Dependency Implementation,
then that Dependency Implementation becomes a Qualified Dependency . A Dependency
Specification uses a Qualifier Key to reference the Qualified Dependency to be used. We define
a Decorator as a Dependency Implementation that is also a Consumer of the same Dependency
it implements. We employ an axiom to describe the rule regarding Abstract Dependencies,
namely: there must be at least one Dependency Implementation that is not a Decorator for
every Abstract Dependency.</p>
      </sec>
      <sec id="sec-3-3">
        <title>3.3. DepIn-O: Scopes Module</title>
        <p>A Singleton Dependency means only one instance of the dependency will be created for the
application, hence if multiple distinct Consumers request the same Dependency, all of them will
be supplied with the same instance of said Dependency. In contrast, a Dependent Dependency
means its instances follow the same lifetime as their respective Consumers, therefore if multiple
distinct Consumers request the same Dependency, each one of them will be provided with
a diferent instance of said Dependency. Whenever a Concrete Dependency is not explicitly
specified in regards to its scope, virtually all frameworks or language compilers make it either
singleton or dependent by default.</p>
        <p>Most DI frameworks also provide support for Web-based applications, so we added the
most common Web Scoped Dependency specifications to our Ontology. A Request Scoped
Dependency implies that a new instance of the same dependency will be created for every new
HTTP request, such as refreshing the page. A Session Scoped Dependency indicates that a
new instance of the same Dependency will be created for every new HTTP session, but the same</p>
        <p>Decorator subtype of Dependency Implementation, Consumer.</p>
        <p>Primary Dependency, Qualified Dependency</p>
        <p>subtype of Dependency Implementation;
Dependency Injection characterized by Dependency Specification.</p>
        <p>[Many] Dependency Specification uses [One] Qualifier Key
[One] Qualifier Key refers to [One] Qualified Dependency</p>
        <p>Singleton Dependency, Dependent Dependency,</p>
        <p>Web Scoped Dependency subtype of Concrete Dependency.
instance will be maintained throughout the session. The Application Scoped Dependency
denotes that a single instance of the same dependency will exist for the entirety of the Web
application.</p>
        <p>There are countless other scope-related specializations for dependencies provided by DI
frameworks which we did not include in our ontology due to our delimitations. Furthermore,
many DI frameworks ofer not only predefined scope specializations but also the ability for
users to create customized scopes to suit their specific needs.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Evaluation</title>
      <p>The evaluation of the ontology was performed by verification and validation activities, according
to SABiOx. For Verification , it is necessary to identify if the elements that make up the ontology
are able to answer the competency questions raised as its requirements. Table 2 shows the
result of DepIn-O’s verification.</p>
      <p>For Validation, it is necessary to determine if the ontology matches the reality, that is, if</p>
      <p>Listing 4: Dependency Injection Compositions in Spring.
1 public interface DependencyA { }
2
3 @Component
564 publDicepec nlades nscyCAondsuepm;erCI {
978 p}ubldicepC=ondsua m;erCI ( DependencyA da ) { / / Constructor Injection Point
10 }
11
111432 @puCbomlpipcuobnclelinacts svoCidonssoummeeMrMeItho{d ( DependencyA da ) { } / / Method Injection Point
15 }
16
111879 @puCboml@ipcAonucetlnoatwsisredCoDnesupmenedrePnIc{yA dep ; / / Property Injection Point
20 }</p>
      <p>DepIn-O’s concepts can provide a consensual understanding of the domain across diferent
programming languages and frameworks as intended. Therefore, we mapped DepIn-O’s Catalog
of Concepts to instances in all of our chosen frameworks. For brevity, we only present here an
instantiation employing the Java framework Spring, and its corresponding diagram is presented
as supplementary material. The full validation of DepIn-O on the other frameworks is also
available as supplementary material. Note that the code examples from Section 2.1 employed a
“Pure DI” approach, not using resources from any framework.</p>
      <p>As previously stated, for the composition of a Dependency Injection, we need the
Consumer, its Injection Point and the Dependency. In Spring, the @Component annotation is
added to Consumers and Concrete Dependencies to automate their instantiation and to set
up injections when using Constructor and Method Injection Points. However, setting up an
injection with a Property Injection Point also requires the @Autowired annotation. This is
presented in Listing 4.</p>
      <p>Next, we show Dependency Implementations. To instantiate a Primary Dependency,
we use @Primary alongside @Component (however, when there is only one implementation
provided to the abstraction, @Primary is optional). For a Qualified Dependency , besides
@Component, we need to use the @Qualifier(“label”) annotation at the Injection Point — where
“label” is the Qualified Key and can be a name of our choice — and add to the Dependency
Specification a matching @Qualifier(“label”) . One of the possible ways to implement a
Decorator in Spring is to set it up as a Primary Dependency and as a Consumer of a Qualified
Dependency, as shown in Listing 5.</p>
      <p>In regards to specializing our Concrete Dependencies by their scopes, Spring uses Singleton
Dependencies by default, though we can add the @Scope(“singleton”) annotation to make it
explicit. For Dependent Dependencies, the annotation @Scope(“prototype”) must be added.
In a Web Application context, we can declare Web Scoped Dependencies, such as Request
Scoped Dependencies, Session Scoped Dependencies, and Application Scoped
Dependencies — in Spring, these specializations can be respectively indicated by the class annotations
@RequestScope, @SessionScope and @ApplicationScope. All are shown in Listing 6.</p>
      <p>
        We also demonstrate a practical application of our Ontology, capturing DI code smells such as
Over-Injection — any combination of Constructor and Property Injection Points that results in
over four dependencies being requested at initialization, a sign of violation of the Single
Responsibility Principle — and Concrete Class Injection — a direct request to a Concrete Dependency by
a Consumer Class, as it causes the loss of the flexibility brought by using abstractions [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. In
order to do that, we extended the operational version of OOC-O written in OWL by adding
DepIn-O concepts, employed the ontology editor Protégé2 and used DL Queries to capture the
code smells. Such application is available as supplementary material, and, although simple,
demonstrates that DepIn-O could be used to detect DI smells in real code bases in combination
with, e.g., the OSCIN method [15].
      </p>
    </sec>
    <sec id="sec-5">
      <title>5. Related Works</title>
      <p>We searched the literature for works within the domain of Dependency Injection and ontology
construction. However, to our knowledge, there are no works that instigate an intersection
between DI and ontologies. We then broadened the scope of our search for works that explore the
DI domain itself or the ontological representation involving the domain of software frameworks.</p>
      <p>
        Concerning the fundamental concepts from the DI domain and their application on DI
frameworks, [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] explain and explore the same subject as we did. The contrast between
their works and ours is that their approach is mostly didactic, while we anchored our work on
ontological foundations.
      </p>
      <p>The Object/Relational Mapping Ontology (ORM-O) [16] shares similarities to our work
regarding the ontological foundation — e.g., both use UFO as Foundational Ontology and add
specializations to the OOC-O — and the methods employed — e.g., ORM-O was built following
SABiO and DepIn-O was built following SABiO’s newer extension SABiOx; also, both had
their concepts presented in a Catalog of Concepts and instantiated in a select group of popular
frameworks. The major diference between the two works comes to the domain: ORM-O deals
with Object/Relational Mapping whereas DepIn-O is concerned with Dependency Injection,
still, both are contained within the larger Objected-Oriented Programming domain.</p>
      <p>Related to the practical application of DepIn-O, the Dependency Injection For Web Services
(DI4WS) [17] is a development model implemented in Java for the construction of Web Service
applications. This approach involves mining an already existing code to find a list of candidate
services for DI and refactoring the code by having the services (selected from the list by the
developer) injected into the application. On the other hand, we are more interested in following
an inverse path: with a solid domain ontology on DI, we aim to create tools that will support
the developer to create applications with DI patterns implemented from the start.</p>
      <p>The catalog of DI anti-patterns from [18] was compiled after the development of a static code
analyzer tool that revealed the large presence of a number of DI anti-patterns in open-source
projects and is meant to be used as a reference for developers to avoid them. Notably, this
reference aligns with our research objectives, albeit through a distinct approach, as employing
DepIn-O to provide tools for detecting code smells and anti-patterns is one of many practical
applications of our ontology.</p>
      <p>Another work that shares a degree of similarity to ours is [19], since its first step is to describe
the Model-View-Controller (MVC) architectural pattern formally by using the description
language in order to form the MVC architectural pattern ontology of the conceptual layer.
Again, we difer in focus, since our work does not dive into the MVC pattern, but into the
Dependency Injection domain, though there is a connection, as DI patterns can be implemented
into MVC architecture in OO Programming Languages. Another diference is that our primary
focus is not describing our model with a description language but with an ontological-level
language and only as a later step to have it translated into a description language.</p>
    </sec>
    <sec id="sec-6">
      <title>6. Conclusions</title>
      <p>
        In this paper, we presented DepIn-O, an ontology on Dependency Injection software
frameworks. DepIn-O was constructed in compliance with the phases laid out in a detailed ontology
engineering method [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], including extensive research on sources of knowledge from the DI
domain and analysis of some of its most used supporting frameworks from the most popular
object-oriented (OO) languages.
      </p>
      <p>The evaluation of the ontology through verification and validation was successful, as the
requirements elicited through competency questions were answered and full coverage of the
fundamental concepts of our Ontology was provided by instantiation. A simple practical
application of DepIn-O was also illustrated.</p>
      <p>The integration of DepIn-O with the Object-Oriented Code Ontology (OOC-O) also aims to
add our ontology to a wider ongoing efort on the construction of a network of ontologies on
various diferent subdomains of software development, contributing to it on the DI area.</p>
      <p>For future works, we intend to further evaluate DepIn-O in practice, implementing a tool
that automates tasks, e.g., code migration or smells detection, over source code bases that use
DI frameworks. We also intend to use the ontology to propose improvements to the modeling
language of FrameWeb [20], a Web Engineering method that incorporates the concepts of
frameworks (including DI frameworks) to architectural models.</p>
    </sec>
    <sec id="sec-7">
      <title>Acknowledgments</title>
      <p>This research was conducted with the financial support of the Foundation for Support to
Research and Innovation of Espírito Santo (Fundação de Amparo à Pesquisa e Inovação do
Espírito Santo — FAPES).
Analysis of Software System Anomalies and their Associated Risks, Data &amp; Knowledge
Engineering 134 (2021) 101892. doi:10.1016/j.datak.2021.101892.
[14] Stack-Overflow, Stack Overflow Developer Survey 2022, https://survey.stackoverflow.co/
2022/, 2022.
[15] C. Z. de Aguiar, F. L. Zanetti, V. E. S. Souza, Source Code Interoperability based on Ontology,
in: Proc. of the 17th Brazilian Symposium on Information Systems, Uberlândia, MG, Brasil,
2021, pp. 1–8. doi:10.1145/3466933.3466951.
[16] F. L. Zanetti, C. Z. de Aguiar, V. E. S. Souza, Representação Ontológica de Frameworks de
Mapeamento Objeto/Relacional, in: Proc. of the 12th Seminar on Ontology Research in
Brazil (ONTOBRAS 2019), CEUR, Porto Alegre, RS, Brasil, 2019, pp. 1–12.
[17] M. Crasso, C. Mateos, A. Zunino, M. Campo, Empirically Assessing the Impact of DI on
the Development of Web Service Applications, Journal of Web Engineering 9 (2010) 66–94.
[18] R. Laigner, D. Mendonça, A. Garcia, M. Kalinowski, Cataloging Dependency Injection
Anti-Patterns in Software Systems, Technical Report, Version accepted at The Journal of
Systems &amp; Software, 2021. doi:10.48550/ARXIV.2109.04256.
[19] Y. Qiang, W. Lulu, L. Bixin, Identify MVC Architectural Pattern Based on Ontology,
in: Proc. of the 31st International Conference on Software Engineering and Knowledge
Engineering, SEKE 2019, 2019, pp. 612–617. doi:10.18293/SEKE2019-163.
[20] V. E. S. Souza, The FrameWeb Approach to Web Engineering: Past, Present and Future,
in: J. P. A. Almeida, G. Guizzardi (Eds.), Engineering Ontologies and Ontologies for
Engineering, 1 ed., NEMO, Vitória, ES, Brazil, 2020, pp. 100–124. URL: http://purl.org/
nemo/celebratingfalbo.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>M.</given-names>
            <surname>Fowler</surname>
          </string-name>
          ,
          <article-title>Refactoring: Improving the Design of Existing Code, Addison-</article-title>
          <string-name>
            <surname>Wesley</surname>
          </string-name>
          , Boston, MA, USA,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>C. Z. de Aguiar</surname>
          </string-name>
          ,
          <article-title>Interoperabilidade Semântica entre Códigos-Fonte baseada em Ontologia</article-title>
          ,
          <source>Technical Report</source>
          , Tese de Doutorado, Programa de Pós-Graduação em Informática.
          <source>Universidade Federal do Espírito Santo</source>
          , Vitória,
          <string-name>
            <surname>ES</surname>
          </string-name>
          , Brasil,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>G.</given-names>
            <surname>Guizzardi</surname>
          </string-name>
          , G. Wagner,
          <string-name>
            <given-names>J.</given-names>
            <surname>Almeida</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Guizzardi</surname>
          </string-name>
          ,
          <article-title>Towards Ontological Foundations for Conceptual Modeling: The Unified Foundational Ontology (UFO) Story</article-title>
          , Applied ontology
          <volume>10</volume>
          (
          <year>2015</year>
          ). doi:
          <volume>10</volume>
          .3233/AO-150157.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>C. Z. de Aguiar</surname>
            , R. de Almeida Falbo,
            <given-names>V. E. S.</given-names>
          </string-name>
          <string-name>
            <surname>Souza</surname>
          </string-name>
          ,
          <string-name>
            <surname>OOC-O: A Reference Ontology on Object-Oriented</surname>
            <given-names>Code</given-names>
          </string-name>
          , in: A.
          <string-name>
            <surname>H. F. Laender</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          <string-name>
            <surname>Pernici</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          <string-name>
            <surname>Lim</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. P. M. de Oliveira</surname>
          </string-name>
          (Eds.),
          <source>Conceptual Modeling - 38th International Conference, ER</source>
          <year>2019</year>
          , Salvador, Brazil, November 4-
          <issue>7</issue>
          ,
          <year>2019</year>
          , Proceedings, volume
          <volume>11788</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2019</year>
          , pp.
          <fpage>13</fpage>
          -
          <lpage>27</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>030</fpage>
          -33223-
          <issue>5</issue>
          _3. doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>030</fpage>
          -33223-5\_3.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>G.</given-names>
            <surname>Guizzardi</surname>
          </string-name>
          ,
          <article-title>Ontological Foundations for Structural Conceptual Models</article-title>
          ,
          <source>Ph.D. thesis</source>
          , University of Twente, Enschede, The Netherlands,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>S. van Deursen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Seemann</surname>
          </string-name>
          , Dependency Injection: Principles, Practices and Patterns, Manning, Shelter Island,
          <string-name>
            <surname>NY</surname>
          </string-name>
          , USA,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>M.</given-names>
            <surname>Bojkic</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Przulj</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Stefanovc</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Ristic</surname>
          </string-name>
          ,
          <article-title>Usage of Dependency Injection within diferent frameworks</article-title>
          ,
          <source>in: 19th International Symposium INFOTEH-JAHORINA (INFOTEH</source>
          <year>2020</year>
          ),
          <year>2020</year>
          , pp.
          <fpage>119</fpage>
          -
          <lpage>124</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Airfocus</surname>
          </string-name>
          ,
          <article-title>What is a dependency?</article-title>
          , https://airfocus.com/glossary/what-is
          <string-name>
            <surname>-</surname>
          </string-name>
          a-dependency/,
          <source>2020. Accessed in October 1</source>
          ,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>E.</given-names>
            <surname>Mnkandla</surname>
          </string-name>
          , About Software Engineering Frameworks and Methodologies,
          <source>in: Proc. of AFRICON</source>
          <year>2009</year>
          ,
          <year>2009</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>5</lpage>
          . doi:
          <volume>10</volume>
          .1109/AFRCON.
          <year>2009</year>
          .
          <volume>5308117</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>G.</given-names>
            <surname>Guizzardi</surname>
          </string-name>
          , Ontology, Ontologies and the “I”
          <string-name>
            <surname>of</surname>
            <given-names>FAIR</given-names>
          </string-name>
          ,
          <source>Data Intelligence</source>
          <volume>2</volume>
          (
          <year>2019</year>
          )
          <fpage>181</fpage>
          -
          <lpage>191</lpage>
          . doi:
          <volume>10</volume>
          .1162/dint_a_
          <fpage>00040</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>R. A.</given-names>
            <surname>Falbo</surname>
          </string-name>
          ,
          <article-title>SABiO: Systematic Approach for Building Ontologies</article-title>
          ,
          <source>in: Proc. of the 1st Joint Workshop ONTO.COM / ODISE on Ontologies in Conceptual Modeling and Information Systems Engineering</source>
          , volume
          <volume>1</volume>
          , CEUR,
          <year>2014</year>
          , pp.
          <fpage>17</fpage>
          -
          <lpage>31</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>F. B.</given-names>
            <surname>Ruy</surname>
          </string-name>
          , R. d. A.
          <string-name>
            <surname>Falbo</surname>
            ,
            <given-names>M. P.</given-names>
          </string-name>
          <string-name>
            <surname>Barcellos</surname>
            ,
            <given-names>S. D.</given-names>
          </string-name>
          <string-name>
            <surname>Costa</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          <article-title>Guizzardi, SEON: A Software Engineering Ontology Network</article-title>
          ,
          <source>in: Proc. of the 20th International Conference on Knowledge Engineering and Knowledge Management</source>
          , Springer,
          <year>2016</year>
          , pp.
          <fpage>527</fpage>
          -
          <lpage>542</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>B. B.</given-names>
            <surname>Duarte</surname>
          </string-name>
          , R. d. A.
          <string-name>
            <surname>Falbo</surname>
            , G. Guizzardi,
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Guizzardi</surname>
            ,
            <given-names>V. E. S.</given-names>
          </string-name>
          <string-name>
            <surname>Souza</surname>
          </string-name>
          , An Ontological
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>