A Metadata Based Components Model PDF
A Metadata Based Components Model PDF
1 Problem Description
There are many ways for a component or a framework to be reusable and adaptable.
Specialization of the component classes and implementation of its interfaces, allows
the application to extend the behavior and to adapt it to its needs [1] [2]. For instance,
the use of dependency injection, allows the client to insert the instances that composes
the component [3], changing the behavior based on the class and information of the
instance inserted. Combining these techniques, the developer combines composition
and inheritance to enable flexibility and reuse in the component. These techniques are
used in design patterns to document common solutions for some recurrent problems
in object-oriented applications [4].
Another approach to achieve flexibility and a high reuse degree are used in some
recent frameworks. These frameworks process its logic based on metadata configured
for the application classes. This allows those frameworks to be more close to the
application classes and adapt its behavior in runtime based on the metadata. The
metadata describes additional data about attributes, methods and classes that are
relevant for the component processing. This proposed research will explore this kind
of component.
This approach became more popular in the Java Platform after the incorporation of
annotations natively in the programming language [5]. The metadata can be stored not
only using annotations, but also in external files (usually as XML documents),
databases or programmatically. The metadata can also be configured implicitly using
name conventions [6].
The following are examples of frameworks and APIs that uses this approach:
Hibernate [7] and JPA [8] uses metadata to create an object-relational mapping and to
manage events in different phases of an instance persistence process; EJB [8] uses
metadata to configure how the container is going to control some non-functional
features, like transaction strategy and access control policy; JAXB [9] do the mapping
between the application object model and a XML document using metadata; JUnit
[10] identifies test and life cycle methods of a test class by metadata.
The use of this kind of component can lead to a high degree of reuse, because some
logic that deals with specificities of the application classes can be done by the
component using the metadata information. In traditional frameworks, this kind of
logic is implemented programmatically in the application extending the frameworks
classes or implementing its interfaces. This new approach exchanges an imperative
code, for the declaration of the class metadata.
All existent metadata-based components are created based only on the experience
of its developers, because there are not documented techniques or best practices for
dealing with metadata. There are many situations that the metadata approach could be
used with advantages, but because of the little documentation about it few
components of this kind are created.
2 Goal Statement
The goal of this work is to propose a metadata-based components model, to ease the
development of flexible software components and increase the application reuse. This
model must be a reference for solving design problems about how to deal with
metadata in this kind of component. The model must be also the basis for other
studies about metadata-based components.
This work investigates the following key questions about the metadata-based
components:
1. What are the characteristics that metadata-based components had in common?
2. What kind of problems can be addressed using metadata-based components?
3. What are the design requirements that may appear in this kind of components
because of the use of metadata?
4. How are the existent metadata-based components designed? How do they deal
with class metadata?
5. How much reuse degree can an application get using a metadata-based
component?
6. How much easier and faster is to develop an application using a metadata-based
component?
3 Approach
4 Validation
The work will be validated both quantitatively and qualitatively. The qualitative
validation will occur during the research, comparing the patterns and the model to
existent frameworks and using them in case studies. The case studies will validate if
the proposed patterns fulfils some flexibility requirements about metadata
manipulation. To validate that the application of the proposed model in a component
really improve the reuse degree of the software that uses it, an experiment will be
accordingly defined.
In this experiment, the same problem will be addressed using tree kind of
approaches: (a) without frameworks; (b) with a traditional framework and (c) with a
metadata-based framework. The goal of the experiment is to have different solutions
with the same interface and behavior, which can be used to do a comparative study.
There will be at least tree teams, each one with a different problem. The experiment
will use groups of undergraduate students of the object orientation course. The
following phases will be considered:
· Phase 1: The teams have to solve the problem without using frameworks. There
will be an interface that they must use in the implementation. Some automated
integration tests will be developed to ensure that the behavior is correct.
· Phase 2: The teams have to develop a traditional framework to help someone to
solve similar problems that they solve in Phase 1. The documentation for this
framework must be created.
· Phase 3: The teams have to exchange the problems and implement the same
problem of Phase 1 with the framework developed in Phase 2. The same tests
created in Phase 1 must execute successfully.
· Phase 4: The team that developed the framework in Phase 2 has to evolve it by
using the metadata-based approach. The metadata-based component model
developed must be used. The team must suitably document the framework.
· Phase 5: A new team that did not already dealt with the problem have to
implement it using the metadata-based component created in Phase 4. The same
tests created in Phase 1 must execute successfully.
A comparative study will be made based on the solutions created by the students in
the experiment. Some metrics for reuse [14] and code complexity will be used to
analyze quantitatively each approach. The students will also answer some
questionnaires for a qualitative analysis of the experiment. The validation will focus
on the quantitative metrics, but the questionnaires could also lead to some interesting
results.
The main goal of the quantitative study is to show that applications that use
metadata-based components created using the proposed model have a high degree of
reuse compared to those created with traditional frameworks techniques. The
qualitative study should also detect that the implementation with metadata-based
components is more productive and easier than using traditional frameworks.
References