A Model To Enable The Reuse of Metadata-Based Frameworks in Adaptive Object Model Architectures
A Model To Enable The Reuse of Metadata-Based Frameworks in Adaptive Object Model Architectures
fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Date of submission September 17, 2020, date of current version December 7, 2020.
Digital Object Identifier 10.1109/ACCESS.2017.DOI
ABSTRACT Context: The Adaptive Object Model (AOM) is an architectural style in which domain
entity types are represented as instances that can be changed at runtime. It can be used to achieve higher
flexibility in domain classes. Due to AOM entities having a distinct structure, they are not compatible
with most popular frameworks, especially those that use reflection and code annotations. Objective:
To solve such limitations, this work aims to propose a model that enables the reuse of frameworks
designed for classic object-oriented domain models in an AOM application. Methods: The proposed model
uses dynamically-generated adapters for AOM entities that encapsulate them in a class with the format
expected by the frameworks. A reference implementation was developed in the Esfinge AOM RoleMapper
framework to evaluate the viability of the proposed model. Initially, to evaluate the solution feasibility,
a case study was carried out using the Hibernate framework. Further, an experiment was conducted to
assess how the participants perceived the framework functionality reuse through the proposed model.
Results: The feasibility study revealed that the solution could be applied in a complex setting for the
chosen object-relational mapping frame. It raised some difficulties that can be addressed in future studies.
In the experiment, the development time did not present a significant difference compared to the competing
approach. Despite the considerable learning curve, most participants considered that the proposed approach
has more advantages than the alternative. Conclusion: Based on the evaluations, we can conclude that the
proposed model can be successfully employed to use AOM entities with frameworks that were not designed
for AOM applications. The possibility of reusing existing frameworks can reduce the effort required to
adopt an AOM architecture and, consequently, be a facilitator in implementing more flexible and adaptive
approaches.
INDEX TERMS Adaptive Architecture, Adaptive Object Model, Metadata, Object-Oriented Design, Run-
time environment, Software architecture , Software engineering, Software Framework, Software reusability,
Software tools.
VOLUME X, 20XX 1
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.
Several more recent studies employed AOM concepts for work, and also in an experiment, in which the participants had
several applications and domains, such as for economy me- to implement data validation for entities based on a given set
chanics in digital games [3], model-driven architectures [4], of constraints. In the case study, the goals was to evaluate
[5], data evolution in digital ecosystems [6], meta-modeling the feasibility of the proposed approach in more complex
architectures [7], and dynamic web services [8], [9]. That can scenarios. The goals of the experiment are: (i) to assess if
be considered an evidence that this architectural style is still the proposed approach requires more time of development
relevant and applied in recent works. than an approach using imperative code; and (ii) to verify
To handle the entities and entity types defined in a different the perception of the developers to its ease of use, useful-
structure, an AOM architecture often needs custom-tailored ness, and benefits. Half of the participants implemented the
software components [1]. These components are necessary, constraints for each type of entity directly retrieving and
for instance, to persist entities and present them in the user in- checking the values, and the other half defined additional
terfaces. The effort required to develop such components can metadata mapped to Hibernate Validator annotations. As a
be considered a drawback of AOM systems since, for regular result, the case study showed that it is possible to use the pro-
information systems, some components and frameworks can posed solution with composed entities in an object-relational
be reused in several systems layers. mapping framework. Additionally, all participants were able
As an attempt to enable the reuse of AOM components to complete the experiment, the difference in development
among applications, some AOM frameworks, like Oghma time was not significant, and 86% of them would choose the
[10] and Ink [11], provide ready-to-use classes that can be proposed approach, highlighting the improved maintainabil-
used to define entity types and create entities. Since these ity and the increase in the reuse of existing frameworks.
classes are not attached to any specific domain, we call This work’s main contribution is the proposed AOM
this approach as domain-independent in this article. The framework model that allows the reuse of frameworks de-
solutions also provide components for the architecture of signed to be used in regular classes. There is no other work
AOM applications based on their own AOM structure. A in the literature that provides a solution to this problem.
drawback of this approach for AOM frameworks is that it Additionally, a reference implementation of this solution was
is not possible to add domain-specific features in the AOM implemented in the AOM framework Esfinge RoleMapper
model, which is very common in AOM applications since and used for two different evaluations: a more complex case
it drives implementation towards application requirements, study to assess the feasibility and a controlled experiment
especially for business rules that handle the entities directly. with developers.
The adoption of an AOM architectural style also prevents This article is organized as follows: Section II presents
the usage of frameworks created for regular static classes. the main concepts about AOMs and reflective and metadata-
For instance, the Java Beans standard [12] defines in the based frameworks; Sections III and IV present respectively
Java language a way to define application entities by us- the proposed AOM framework model and the Esfinge AOM
ing the prefix "get" and "set" for access methods. Several RoleMapper implementation; Section V presents a case study
frameworks that use reflection and code annotations [13] with Hibernate; Sections VI and VII respectively report how
consider this standard for processing entities. Since AOM the experiment was designed and its results; Section VIII
entities do not provide this same API style, none of those discuss the results; Section compares the proposed approach
frameworks can be reused when this architectural style is with other existing AOM frameworks; finally, Section X
adopted. The AOM frameworks previously mentioned [10], concludes the work.
[11] provide their components. Nevertheless, the applications
are limited to them. This lack of reuse increases the cost
II. BACKGROUND
of developing AOM applications since the functionality of
several components that could be reused would need to be A. ADAPTIVE OBJECT MODELS
developed from scratch. Adaptive Object Model is an architectural style for systems
The goal of this work is to propose a framework model for in which classes, attributes, relationships, and behaviors are
AOM architectures that aims to increase the reuse of com- represented as metadata consumed at runtime [1]. Moreover,
ponents and frameworks created for static class models. The the same code can process different entities unknown at
proposed framework model was implemented in an existing compile time. This architecture enables systems to be flexible
Java AOM framework named Esfinge AOM RoleMapper and easily adaptable at runtime, not only by programmers
[14]. Our approach uses bytecode manipulation to create but also by business analysts and end-users. Consequently,
at runtime an adapter for the AOM entity that is based on this flexibility allows changes to be very quickly made and
the Java Beans standard [12]. A mapping between AOM released, enabling the domain to evolve smoothly as part of
entity type metadata and code annotations is performed to the business.
enable the addition of the reused framework annotations in The AOM structure is created based on patterns, such as
the dynamically generated class. Type Object, Property, Type Square, Accountability. This
The proposed approach was evaluated through a case section aims to present these main patterns that are important
study, where the solution was applied with a complex frame- to understand how an AOM application works. A complete
2 VOLUME X, 20XX
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.: A Model to Enable the Reuse of Metadata-based Frameworks in Adaptive Object Model Architectures
set of patterns to create an AOM Pattern Language is pro- Likewise, existing entity types can be changed at runtime,
posed on [15]. since modeling is done at the instance level.
The Type Object [16] is used in situations where the num-
ber of subclasses that a class may need cannot be determined
during the system development. This pattern represents the
subtypes that are not known at development time as instances
of a class that represents a type.
In Fig. 1, the class Sensor is composed of an instance
of the class SensorType. The SensorType instance contains
information about the type of the Sensor. The class-instance
relationship that existed in a classic object-oriented model
is now represented as a composition, where the Sensor in-
stances have a reference to instances of SensorType. New
instances of SensorType might be created at runtime to
represent new types of sensors. FIGURE 3. Type Square pattern sample
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.: A Model to Enable the Reuse of Metadata-based Frameworks in Adaptive Object Model Architectures
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.: A Model to Enable the Reuse of Metadata-based Frameworks in Adaptive Object Model Architectures
advanced features might be mapped as custom metadata, • @PropertyType: (Class) classes that play the Prop-
which can be retrieved and processed by AOM components erty Type role in the AOM architecture; (Field) the
that use the domain-independent model. Following this ap- attribute that refers to a Property Type corresponding to
proach, the framework AOM model might remain simple and a Property;
with the features that are more frequently needed in AOM • @EntityProperties: (Field) the attribute that
applications, but without limiting the applications only to refers to Properties of an Entity;
these features. • @FixedEntityProperty: (Field) attributes corre-
sponding to fixed properties in an Entity class;
B. MAPPING DOMAIN-SPECIFIC AOM MODELS • @Name: (Field) the attribute containing the name of an
The framework also supports the usage of domain-specific Entity Type or a Property Type;
AOM classes. The application classes that play a role in the • @PropertyTypeType: (Field) the attribute contain-
AOM architecture should receive code annotations for the ing the type of a Property Type;
framework to identify these roles and create adapters based • @PropertyValue: (Field) the attribute containing
on the domain-independent AOM model. This approach en- the value of a Property;
ables the reuse of AOM components created for the domain- • @CreateEntityMethod: (Method) the method of
independent AOM model in the application that defines its an Entity Type class that handles with the creation of
own AOM classes. an Entity with this type;
Another benefit of allowing the application to define its • @Metadata: (Field) a metadata list of a class that
own domain-specific AOM classes is that it has more free- represents an Entity Type or a Property Type.
dom to define a more suitable structure based on its adapt- • @FixedMetadata: (Field) a fixed metadata variable
ability requirements. As presented by a previous work [39], of a class that represents an Entity Type or a Property
the mapping enables the model to start simple and be evolved Type.
to implement more patterns. That also allows the specific • @MetadataMap: (Field) a metadata map of a class that
AOM model to contain more specific business rules and to represents an Entity Type or a Property Type.
have features not implemented by the framework domain- List. 3 presents an example of how the framework cre-
independent AOM model, such as entity type inheritance. ate adapters from mapped domain-specific AOM classes
List. 2 presents a domain-specific class that represents to its domain-independent API. The classes SensorType
an AOM entity configured with Esfinge AOM RoleMapper and Sensor are application-specific implementations of an
annotations. The annotation @Entity specifies that the AOM. The presented code create adapters to the framework
class plays the Entity role in AOM. Its attributes also receive API that can be reused by several applications with its own
annotations to map to what they represent. AOM model.
As expected, using the adapters will generate a perfor-
1 @Entity mance overhead introduced by the new layer introduced.
2 public class Sensor implements ISensor { This overhead is higher in creating the adapter when the
3
4 @EntityType framework search for annotations in the class elements using
5 private SensorType SensorType; reflection. In the adapter’s usage, the overhead will be mainly
6
7 @FixedEntityProperty an additional dynamic invocation to the adapted class mem-
8 private String owner; bers. An analysis of the adapters’ overhead from a domain-
9
10 @EntityProperty specific API to a domain-independent API was performed in
11 private List<SensorProperty> properties a previous study [38].
12 = new ArrayList<SensorProperty>();
13
14 //access methods omitted C. ADAPTING ENTITIES TO JAVA BEANS
15 }
The Esfinge AOM RoleMapper framework is able to adapt
AOM Entities to classes following the Java Bean specifica-
LISTING 2. Mapping domain-specific class that represents an entity. tion. For each property in the AOM entity, getter and setter
methods that handle the property value will be created in
The following list describes the core mapping annotations the Bean adapter. Additionally, if the entity type or an entity
defined by the framework. The annotation description ex- property has metadata, the generated adapter class might be
plains how the framework interprets it based on whether it created with a respective annotation. This section describes
is present in a class, field, or method: how the Esfinge AOM RoleMapper framework generates the
• @EntityType: (Class) classes that play the Entity Java Bean adapters.
Type role in the AOM architecture; (Field) an attribute The adapter is generated using bytecode manipulation. The
that references the Entity Type corresponding to an implementation used the ASM library. The class responsible
Entity; for generating the adapters is the AdapterFactory. When
• @Entity: (Class) classes that play the Entity role in an instance of the AdapterFactory is created, it is possi-
the AOM architecture; ble to pass as a parameter a file name with the annotation
VOLUME X, 20XX 7
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.: A Model to Enable the Reuse of Metadata-based Frameworks in Adaptive Object Model Architectures
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.
Contact. The metadata were added in the AOM structure 1 //Creating entity type and property of COntact type
mapping a one-to-one relationship, as if there was a Client 2 IEntityType clientType = new
GenericEntityType("Client");
class with the @OneToOne Hibernate annotation. The entity 3 IPropertyType contactPropertyType = new
types were created using the domain-independent API of the GenericPropertyType("mainContact", contact);
4 clientType.addPropertyType(contactPropertyType);
Esfinge AOM RoleMapper framework. The code snippets 5
presented in this section aim to illustrate the process, and 6 //Configuring one to one relationship metadata
7 Map<String, Object> oneToOneParams = new HashMap<>();
parts of it might be omitted to focus on the most important 8 oneToOneParams.put("cascade", CascadeType.REMOVE);
parts. 9 oneToOneParams.put("fetch", FetchType.EAGER);
10 contactPropertyType.setProperty("oneToOne",
oneToOneParams);
11 Map<String, Object> joinColParams = new HashMap<>();
A. CODE DESCRIPTION 12 joinColParams.put("name", "fk_contact");
13 contactPropertyType.setProperty("joinColumn",
The Contact entity type should be created first, since it joinColParams);
would be used as the type of a property from the Client
entity type. A sample of the code that generates Contact
entity type is presented in List. 7. In this code, the metadata LISTING 8. Creation of Client entity with mapped Hibernate annotations.
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.: A Model to Enable the Reuse of Metadata-based Frameworks in Adaptive Object Model Architectures
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.: A Model to Enable the Reuse of Metadata-based Frameworks in Adaptive Object Model Architectures
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.
d: Conclusion Validity
TABLE 4. Hypothesis testing on time spent on each approach and task.
Threats to conclusion validity concern issues that could af-
fect our analysis about the outcomes of the experiment, for
Group Task Approach Shappiro-Wilk t-Test Wilcoxon
instance, choice of sample sizes, choice of statistical tests,
care taken in the implementation and measurement of an G1 T1 A1 .001 N/A .556
T2 A2 .038
experiment [41]. This experiment has low statistical power of G2 T2 A1 .299 .215 N/A
the tests since the number of participants is not enough to ob- T1 A2 .777
tain a significant effect. Hence, we have considered the data
as indicators rather than conclusive. Regarding the choice
of statistical tests, we have verified the normality of data adapter for the AOM entity than performing the same task
before choosing them. Thus, we used both parametric and using imperative code.
non-parametric statistics to test our hypotheses, considering The results of our analysis are presented in Table 4.
that our analysis was carried out in paired samples. Besides, As showed in Table 4, the result of the t-Test (p-value =
we chose an appropriate level of significance when testing 0.215) and the result of the Wilcoxon test (p-value = 0.556)
the null hypotheses. revealed no statistically significant differences at the 0.05
level of alpha. This indicated that the null hypothesis could
VII. EXPERIMENT RESULTS not be rejected. Therefore, the time required to complete the
This section presents the experimental study results, and it is tasks in both approaches is similar. The small differences
organized to answer tour five Research Questions (RQ), as between the two approaches may be related to other factors,
follows. such as the participants’ experience.
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.: A Model to Enable the Reuse of Metadata-based Frameworks in Adaptive Object Model Architectures
5 presents the contingency table for difficulties encountered showed that there is no association between the perceived
by them. drawbacks and the approaches or tasks.
As shown in Table 5, about 29% of the participants en-
countered difficulties in understanding the specification and E. ACCEPTANCE LEVEL (RQ5)
documentation in both approaches. Specifically, concerning As mentioned earlier, we questioned the participants on
the proposed approach, 52.38% of the participants (11 of which of the two approaches they would choose to implement
21) stated that the main difficulty was to define metadata a given validation feature. Also, we asked them to provide
in AOM entities. Difficulties in knowing methods related to the reason for their choices. This question intended to collect
String (14.29%) and Date (28.57%) were issues exclusively the level of acceptance of the developers concerning the
encountered when some participants used the imperative approach proposed of reusing functionality of a framework
code (A1), while to handle the Java Bean Adapter was an that uses the generated adapter for the AOM entity. Analysis
issue encountered when 6 participants (28.57%) were using of the qualitative data consisted of mapping the reasons
the proposed approach (A2). related by participants with the difficulties, advantages, and
For each question about the difficulties, we applied drawbacks, which were mentioned in previous sessions.
Fisher’s exact test to verify the following null hypothesis Only three participants chose approach A1. One of the
H02: The difficulties encountered are not associated with the participants (P1) justified his choice by highlighting two
approaches or task type. Fisher’s exact test showed only an difficulties of approach A2: (i) difficulties to handle the Java
association between the difficulty to work with the Hibernate Bean; and (ii) difficulties in defining and mapping metadata.
Validator framework and the approach (A2) related to Task As a justification, the second participant (P15) highlighted
1 that was performed by the G2 group (p ≤ 0.05). That two benefits of approach A1: flexibility and greater control
is, the group that performed Task 1 using Esfinge AOM in development. Moreover, the third participant justified his
Role Mapper, reported that it was more difficult to use the choice also because of the difficulty of defining and mapping
metadata-based framework used. However, since both tasks metadata. Such reasons may be related to the participants’
used similar constraint types, we did not find any particular length of professional experience since productivity seems to
reason for this association. be a key measure.
The other 18 participants (85.7%) chose the proposed
D. PERCEIVED BENEFITS AND DRAWBACKS (RQ4) approach (A2). Despite a learning curve required to under-
Table 6 the contingency table for benefits of both approaches stand how to do (P20) and other difficulties encountered,
perceived by participants. Regarding approach A1, the main some participants perceived the usefulness of the approach
benefit pointed out by 8 participants was simplicity, which due to reusing the code (P2, P6). After the learning period,
was not mentioned by any participant regarding the proposed some participants perceived that the result could be easier to
approach (A2). However, some participants recognized as maintain (P3, P4, P8, P14). Several participants mentioned
benefits of the proposed approach (A2) the ease of mainte- the simplicity and efficiency of the approach to insert and
nance (5 of 21), the fact on reusing an existing framework change validations consistently (P5, P7, P8, P9, P10, P11,
(6 of 21), and the possibility to store and quickly change the P13, P16, P18, P20), as well as code flexibility with the
validation metadata (6 of 21). creation of adapters (P8, P18) and its readability (P17). One
For each question about the benefits, we applied Fisher’s of the participants (P9) stated that, from understanding how
exact test to verify the following null hypothesis H03: The to do the transformation for Java Beans, writing the specifica-
benefits pointed out are not with the approaches or task tions became very intuitive. So, he took only 8 minutes – the
type. Fisher’s exact test showed that there is no association shortest time reported – to complete the task using approach
between the benefits pointed out and the approaches or tasks. A2. Furthermore, one of the participants (P5) suggested
Table 7 presents the contingency table for drawbacks per- creating a set of validation rules to avoid parameterizations
ceived by participants. About 43% of the participants (9 of as much as possible.
21) reported that the main drawback is the repetitive code
generated for various entities in approach A1. Moreover, 6 VIII. DISCUSSION
participants (28.57%) reported that the validation informa- As previously explained, we carried out a case study aimed
tion is “hard-coded”. As for approach A2, about 52% of the to evaluate the feasibility of the solution persisting two enti-
participants (11 of 21) reported that the main drawback was ties with a relationship using the Hibernate framework. The
due to a learning curve required to understand how to do; feasibility was confirmed since the functionality was able to
and 6 participants (28.57%) reported that the task to define be implemented successfully. Additionally, the study iden-
metadata is complex. tified some limitations that can prevent using the proposed
For each question about the perceived drawbacks, we model according to the metadata-based framework’s internal
also applied Fisher’s exact test to verify the following null solutions. Some features that can be incompatible are load-
hypothesis H04: Drawbacks perceived are not associated time metadata reading, ClassLoader compatibility, control of
with the approaches or task type. And, Fisher’s exact test object lifecycle, and bytecode manipulation.
VOLUME X, 20XX 15
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.
Approach 1 Approach 2
Difficulties Task 1 Task 2 Total p* Task 1 Task 2 Total p*
To understand the specification and documentation Yes 3 3 6 4 3 7
No 9 6 15 1.000 5 9 14 0.350
To understand unit tests Yes 1 0 1 0 0 0
1.000 1.000
No 11 9 20 9 12 21
To work with the Esfinge AOM Role Mapper classes Yes 2 4 6 3 2 5
0.331 0.611
No 10 5 15 6 10 16
To know methods related to String Yes 2 1 3 N/A N/A N/A N/A
1.000
No 10 8 18 N/A N/A N/A N/A
To know methods related to Date Yes 3 3 6 N/A N/A N/A N/A
1.000
No 9 6 15 N/A N/A N/A N/A
To work with the Hibernate framework Yes N/A N/A N/A N/A 6 1 7
0.016*
No N/A N/A N/A N/A 3 11 14
To define metadata in AOM entities Yes N/A N/A N/A N/A 5 6 11
1.000
No N/A N/A N/A N/A 4 6 10
To understand and know with Java Bean adapter Yes N/A N/A N/A N/A 3 3 6
No N/A N/A N/A N/A 6 9 15 1.000
Approach 1 Approach 2
Benefits Task 1 Task 2 Total p* Task 1 Task 2 Total p*
Simplicity Yes 4 4 8 0 0 0
0.673 1.000
No 8 5 13 9 12 21
Development speed as benefit Yes 0 1 1 3 1 4
0.429 0.272
No 12 8 20 6 11 17
Ease of maintenance Yes 0 1 1 1 4 5
0.429 0.338
No 12 8 20 8 8 16
Do not require prior knowledge of the developer Yes 4 2 6 N/A N/A N/A N/A
0.659
No 8 7 15 N/A N/A N/A N/A
Flexibility (any kind of validation can be done) Yes 3 0 3 N/A N/A N/A N/A
0.229
No 9 9 18 N/A N/A N/A N/A
Reusing an existing framework Yes N/A N/A N/A N/A 2 4 6
0.659
No N/A N/A N/A N/A 7 8 15
Validation metadata can be stored and changed quickly Yes N/A N/A N/A N/A 3 3 6
No N/A N/A N/A N/A 6 9 15 1.000
Approach 1 Approach 2
Drawbacks Task 1 Task 2 Total p* Task 1 Task 2 Total p*
The generated code is more complex Yes 0 2 2 1 2 3
No 12 7 19 0.171 8 10 18 1.000
Development speed as a drawback Yes 0 1 1 1 0 1
0.429 0.429
No 12 8 20 8 12 20
A repetitive code would be generated for various entities Yes 5 4 9 N/A N/A N/A N/A
1.000
No 7 5 12 N/A N/A N/A N/A
The validation information is hard-coded Yes 4 2 6 N/A N/A N/A N/A
0.659
No 8 7 15 N/A N/A N/A N/A
It is difficult to reuse Yes 2 0 2 N/A N/A N/A N/A
0.486
No 10 9 19 N/A N/A N/A N/A
It is hard to understand Java Bean adapter Yes N/A N/A N/A N/A 0 1 1
1.000
No N/A N/A N/A N/A 9 11 20
It is complex to define Metadata Yes N/A N/A N/A N/A 2 3 5
0.882
No N/A N/A N/A N/A 7 9 16
A great learning curve to understand how to do Yes N/A N/A N/A N/A 5 6 11
No N/A N/A N/A N/A 4 6 10 1.000
16 VOLUME X, 20XX
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.: A Model to Enable the Reuse of Metadata-based Frameworks in Adaptive Object Model Architectures
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.
Role Mapper is that it allows the application to define its FIGURE 12. Example for Entity Definition in Ink.
own AOM model with a suitable level of complexity and
adaptability required by the target application. Additionally, Using two languages, one dynamic for structure and an-
the contribution that is the main focus of this article allows other static language for behavior, the framework combines
the reuse of frameworks created for a regular object-oriented both worlds’ benefits. This approach promotes a style of pro-
structure, which compensate for the need for having several gramming with a strict separation of structure and behavior.
specific components. On the other hand, Oghma only allows To avoid a problem of type duality between the two
the reuse of components created for its own structure. languages, the solution includes an Integrated Development
Environment (IDE) and an Ink Virtual Machine (IVM). The
B. INK IDE imposes mapping rules between types and design-time
Ink [11] is an AOM framework that depends on a Domain- behavior. It validates whether the Java code is compatible
Specific Language (DSL) interpreter to define the entity with the model defined in Ink. The IDE also provides features
model. It follows its predecessor ModelTalk [44] in its that help in the application development, such as incremental
approach based on DSLs. At runtime, instances of DSL constructor and code completion.
classes are instantiated and used as meta-objects for their The IVM is responsible for connecting structure and be-
corresponding Java instances through a technique called havior at runtime. It provides an API to access the model
model-driven dependency injection. Developers can change structure and a meta-object protocol (MOP) to manipulate
the model by editing the Ink configuration in an Eclipse plu- the application model at runtime, for example, to define a
gin specially developed to handle the DSL structure. When new class.
changes to the template are saved, the plugin automatically Two characteristics of Ink that differentiate it from the
invokes the framework DSL parser, which performs cross- other AOM frameworks are the existence of a new language
validation on the system. to define the type structure and a support IDE tool. However,
The Ink’s metamodel comprises constructions to support the unique feature of Esfinge AOM Role Mapper comparing
types, operations, properties, and constraints. Fig. 11 presents it to Ink is the same mentioned for Oghma. While Ink
a class diagram showing the essential elements and rela- provides several ready-to-use components, it is not possible
tionships within the Ink metamodel. As can be seen in this to reuse components that were not explicitly made to ma-
model, almost every class inherits from the class InkObject, nipulate objects using its structure. The solution proposed in
which allows the definition of high-level relationships, such this article and implemented on Esfinge AOM Role Mapper
as "owner". On the right side of the model, starting with allows regular frameworks that use reflection and annotations
InkType, there were the classes for defining the types, and to be reused for AOM entities, which is not possible with Ink.
on the left side, starting with TypedObject, the classes to
represent the instances. X. CONCLUSION AND FUTURE WORK
In the Ink framework, two languages are used collabora- The AOM architectural style [1] is an approach that can
tively to implement the AOM system: Ink and Java. Ink is a be used to develop adaptive and flexible applications. The
language to describe the object-oriented structure. The role peculiar entity API and the creation of domain-specific solu-
of this language is to define the system structure in a way tions prevent the reuse of components, both from other AOM
that it can be dynamically defined and changed at runtime, applications and traditional object-oriented ones. Existing
supporting explicit metaclasses. Fig. 12, [11] presents an ex- AOM frameworks [10], [11] focus on providing domain-
ample of definition of the entity "Movie" with the properties independent models and their own reusable components,
"title" and "rating". The other language is Java, a statically however without offering compatibility with external frame-
object-oriented language to describe behavior. The role of works.
18 VOLUME X, 20XX
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.: A Model to Enable the Reuse of Metadata-based Frameworks in Adaptive Object Model Architectures
The present work proposed an AOM framework model that Conference on Information Reuse and Integration (IRI), 2017, pp. 315–
enables the reuse of reflective and metadata-based frame- 324.
[10] H. S. Ferreira, F. F. Correia, and A. Aguiar, “Design for an adaptive object-
works by creating adapters generated in runtime. The pro- model framework,” in Proceedings of the 4th Workshop on Models@ run.
posed model was implemented in Esfinge AOM RoleMapper, time, held at the ACM/IEEE 12th International Conference on Model
an AOM framework that can work with domain-specific Driven Engineering Languages and Systems (MoDELS’09), 2009.
[11] E. Acherkan, A. Hen-Tov, D. H. Lorenz, and L. Schachter, “The ink
AOMs. Works using previous versions of this framework language meta-metamodel for adaptive object-model frameworks,” in
were already published [8], [38]–[40], but none of them Proceedings of the ACM international conference companion on Object
focused on the generation of adapters containing code an- oriented programming systems languages and applications companion.
ACM, 2011, pp. 181–182.
notations in a way that enable their usage by metadata-based [12] S. Microsystems, “Javabeans(tm) specification 1.01 final release,” Aug.
frameworks. 1997. [Online]. Available: http://download.oracle.com/otn-pub/jcp/7224-
In summary, the main contributions of this work are: (a) javabeans-1.01-fr-spec-oth-JSpec/beans.101.pdf
[13] E. Guerra, F. Alves, U. Kulesza, and C. Fernandes, “A reference
proposal of an AOM framework model that enables the architecture for organizing the internal structure of metadata-based
reuse of existing metadata-based frameworks; (b) a reference frameworks,” J. Syst. Softw., vol. 86, no. 5, pp. 1239–1256, May 2013.
implementation of the proposed framework model in Esfinge [Online]. Available: http://dx.doi.org/10.1016/j.jss.2012.12.024
[14] P. Esfinge, “http://esfinge.sf.net/,” 2017.
AOM RoleMapper; (c) a feasibility study using the Hibernate [15] L. Welicki, J. W. Yoder, R. Wirfs-Brock, and R. E. Johnson, “Towards
framework; and, finally, (d) an experiment that compared the a pattern language for adaptive object models,” ser. OOPSLA ’07.
usage of the proposed approach with the creation of imper- New York, NY, USA: Association for Computing Machinery, 2007, p.
787–788. [Online]. Available: https://doi.org/10.1145/1297846.1297888
ative code, capturing development time and the impressions [16] R. Johnson and B. Woolf, Type Object. USA: Addison-Wesley Longman
of each participant. Publishing Co., Inc., 1997, p. 47–65.
Future works can explore the development of more fea- [17] J. W. Yoder, B. Foote, D. Riehle, and M. Tilman, “Metadata and active
object-models,” in Addendum to the 1998 Proceedings of the Conference
tures for Esfinge AOM RoleMapper and distinct evaluations. on Object-Oriented Programming, Systems, Languages, and Applications
As new functionalities for the framework, we intend to focus (Addendum), ser. OOPSLA ’98 Addendum. New York, NY, USA:
on the limitations identified in the Hibernate case study and Association for Computing Machinery, 1998, p. 0.22–A22. [Online].
Available: https://doi.org/10.1145/346852.346955
the development of tools that can help to manage annotation [18] L. Welicki, J. W. Yoder, and R. Wirfs-Brock, “Adaptive object-
mapping and entity type definition. As new evaluations, the model builder,” in Proceedings of the 16th Conference on Pattern
next studies will consist on experiments and case studies that Languages of Programs, ser. PLoP ’09. New York, NY, USA:
Association for Computing Machinery, 2009. [Online]. Available:
focus on creating an entire application. They will target more https://doi.org/10.1145/1943226.1943231
than one metadata-based framework and the impact of the [19] ——, “Rendering patterns for adaptive object-models,” ser. PLOP ’07.
proposed model in the application design. New York, NY, USA: Association for Computing Machinery, 2007.
[Online]. Available: https://doi.org/10.1145/1772070.1772085
[20] H. S. Ferreira, F. F. Correia, and L. Welicki, “Patterns for data and
REFERENCES metadata evolution in adaptive object-models,” ser. PLoP ’08. New
York, NY, USA: Association for Computing Machinery, 2008. [Online].
[1] J. W. Yoder and R. Johnson, “The adaptive object-model architectural Available: https://doi.org/10.1145/1753196.1753203
style,” in Software Architecture. Springer, 2002, pp. 3–27. [21] A. Hen-Tov, L. Nikolaev, L. Schachter, R. Wirfs-Brock, and J. W.
[2] R. Johnson and J. Oakes, “The user-defined product framework,” URL: Yoder, “Adaptive object-model evolution patterns,” ser. SugarLoafPLoP
http://stwww. cs. uiuc. edu/users/johnson/papers/udp, 1998. ’10. New York, NY, USA: Association for Computing Machinery, 2010.
[3] W. K. Mizutani and F. Kon, “Unlimited rulebook: a reference architecture [Online]. Available: https://doi.org/10.1145/2581507.2581512
for economy mechanics in digital games,” in 2020 IEEE International [22] R. E. Johnson and B. Foote, “Designing reusable classes,” Journal of
Conference on Software Architecture (ICSA), 2020, pp. 58–68. object-oriented programming, vol. 1, no. 2, pp. 22–35, 1988.
[4] R. McClatchey, “The deployment of an enhanced model-driven [23] B. FOOTE and J. YODER, “Evolution, architecture, and metamorphosis,”
architecture for business process management,” in Proceedings of in Pattern Languages of Program Design. Addison-Wesley, 1996, vol. 2,
the 22nd International Database Engineering amp; Applications pp. 295–314.
Symposium, ser. IDEAS 2018. New York, NY, USA: Association [24] C. Bauer and G. King, Hibernate in Action. Greenwich, CT: Manning,
for Computing Machinery, 2018, p. 217–225. [Online]. Available: 2005. [Online]. Available: http://www.amazon.com/Hibernate-Action-In-
https://doi.org/10.1145/3216122.3216155 Christian-Bauer/dp/193239415X
[5] M. Overeem and S. Jansen, “An exploration of the’it’in’it depends’: [25] E. Guerra, J. de Souza, and C. Fernandes, Pattern Language for the
Generative versus interpretive model-driven development.” in MODEL- Internal Structure of Metadata-Based Frameworks. Berlin, Heidelberg:
SWARD, 2017, pp. 100–111. Springer Berlin Heidelberg, 2013, pp. 55–110.
[6] K. J. Lippert, “Towards the evolution of information in digital ecosystems,” [26] E. Guerra and C. Fernandes, “A qualitative and quantitative analysis on
Ph.D. dissertation, University of South Alabama, 2018. metadata-based frameworks usage,” in Computational Science and Its
[7] S. Fioravanti, F. Patara, and E. Vicario, “Engineering the performance Applications – ICCSA 2013, B. Murgante, S. Misra, M. Carlini, C. M.
of a meta-modeling architecture,” in Proceedings of the 8th ACM/SPEC Torre, H.-Q. Nguyen, D. Taniar, B. O. Apduhan, and O. Gervasi, Eds.
on International Conference on Performance Engineering Companion, Berlin, Heidelberg: Springer Berlin Heidelberg, 2013, pp. 375–390.
ser. ICPE ’17 Companion. New York, NY, USA: Association [27] L. O’Brien, “Design patterns 15 years later: an interview with erich
for Computing Machinery, 2017, p. 203–208. [Online]. Available: gamma, richard helm and ralph johnson,” Indianápolis: Informit, Oct,
https://doi.org/10.1145/3053600.3053647 vol. 22, 2009.
[8] A. Dias, E. Guerra, and P. Lima, “An architecture for dynamic [28] JSR, “Jsr 175: A metadata facility for the Java programming language,”
web services that integrates adaptive object models with existing Aug. 2004. [Online]. Available: http://www.jcp.org/en/jsr/detail?id=175
frameworks,” in Proceedings of the XIII Brazilian Symposium on Software [29] ECMA, “Ecma - 334: C# language specification,” Dec. 2017. [Online].
Components, Architectures, and Reuse, SBCARS 2019, Salvador, Brazil, Available: https://www.ecma-international.org/publications/files/ECMA-
September 23-27, 2019. ACM, 2019, pp. 13–22. [Online]. Available: ST/Ecma-334.pdf
https://doi.org/10.1145/3357141.3357602 [30] H. Wada and J. Suzuki, “Modeling turnpike frontend system: A
[9] T. Gottardi and R. T. V. Braga, “Model-oriented web service implemen- model-driven development framework leveraging uml metamodeling
tations compared to traditional web services,” in 2017 IEEE International and attribute-oriented programming,” Model Driven Engineering
VOLUME X, 20XX 19
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.
Languages and Systems, pp. 584–600, 2005. [Online]. Available: ANTONIO DE OLIVEIRA DIAS has a Master
http://www.springerlink.com/index/l166363337837142.pdf degree (2019) in Applied Computing at the Na-
[31] D. Schwarz, “Peeking inside the box: Attribute-oriented tional Institute for Space Research (INPE), São
programming with Java 1.5, part,” 2004. [Online]. Available: José dos Campos, SP, Brazil. He works at Atech
http://archive.oreilly.com/pub/a/onjava/2004/06/30/insidebox1.html Embraer as a Systems Specialist and teaches De-
[32] JSR, “Jsr 220: Enterprise javabeans 3.0,” Aug. 2007. [Online]. Available: vOps and Software Engineering disciplines at Fac-
http://jcp.org/en/jsr/detail?id=220 uldade Impacta. He is an Adaptive Object Model
[33] ——, “Jsr 338: Javatm persistence 2.1,” May 2013. [Online]. Available:
enthusiast.
http://www.jcp.org/en/jsr/detail?id=338
[34] ——, “Jsr 365: Contexts and dependency injection for javatm 2.0,” Jan.
2017. [Online]. Available: http://www.jcp.org/en/jsr/detail?id=365
[35] H. Rocha and H. Valente, “How annotations are used in Java: An empirical
study,” in 23rd International Conference on Software Engineering and
Knowledge Engineering (SEKE), 2011, pp. 426–431.
[36] P. Lima, E. Guerra, P. Meirelles, L. Kanashiro, H. Silva, and F. Silveira,
“A metrics suite for code annotation assessment,” Journal of Systems
and Software, vol. 137, pp. 163 – 183, 2018. [Online]. Available:
http://www.sciencedirect.com/science/article/pii/S016412121730273X
[37] Z. Yu, C. Bai, L. Seinturier, and M. Monperrus, “Characterizing the usage,
evolution and impact of Java annotations in practice,” IEEE Transactions
on Software Engineering, 2019. LUIZ GUSTAVO D. O. VÉRAS has a Doctoral
[38] P. Matsumoto and E. Guerra, “An approach for mapping domain-specific degree (2019) and a Masters’s degree (2013) in
aom applications to a general model,” Journal of Universal Computer Applied Computing at the National Institute for
Science, vol. 20, no. 4, pp. 534–560, apr 2014. Space Research (INPE), São José dos Campos,
[39] E. Guerra and A. Aguiar, Support for Refactoring an Application towards SP, Brazil. He received a Technological degree in
an Adaptive Object Model. Cham: Springer International Publishing, Geoprocessing from the Federal Institute of Ed-
2014, pp. 73–89. ucation, Science and Technology of Piauí (IFPI),
[40] E. Guerra, J. Santos, A. Aguiar, and L. G. Veras, “Dynamic generated Teresina, PI, Brazil, in 2010. Since 2016, he has
adapters from adaptive object models to static apis,” in Proceedings of been a Professor with the Computing Department,
the 22nd Conference on Pattern Languages of Programs, ser. PLoP ’15. at the Federal Institute of Education, Science and
USA: The Hillside Group, 2015. Technology of São Paulo (IFSP). He has experience in system development
[41] C. Wohlin, P. Runeson, M. Höst, M. C. Ohlsson, B. Regnell, and A. Wess-
and geoprocessing. Currently, he is focused on applications of Unmanned
lén, Experimentation in software engineering. Springer Science &
Aerial Vehicles (UAV) in Smart Cities, working with the research group
Business Media, 2012.
[42] V. R. Basili and H. D. Rombach, “The tame project: Towards
"Smart and Sustainable Cities" of IFSP.
improvement-oriented software environments,” Software Engineering,
IEEE Transactions on, vol. 14, no. 6, pp. 758–773, 1988.
[43] V. B. Kampenes, T. Dybå, J. E. Hannay, and D. I. Sjøberg, “A systematic
review of quasi-experiments in software engineering,” Information and
Software Technology, vol. 51, no. 1, pp. 71–82, 2009.
[44] A. Hen-Tov, D. H. Lorenz, A. Pinhasi, and L. Schachter, “Modeltalk: when
everything is a domain-specific language,” IEEE Software, vol. 26, no. 4,
2009.
20 VOLUME X, 20XX
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI
10.1109/ACCESS.2021.3087795, IEEE Access
Guerra et al.: A Model to Enable the Reuse of Metadata-based Frameworks in Adaptive Object Model Architectures
VOLUME X, 20XX 21
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/