Dissertação apresentada na Faculdade de Ciências e Tecnologia da Universidade Nova de Lisboa para a obtenção do grau de Mestre em Engenharia Informática.With the constant evolution of software systems need arises for more structured implementations,
where processes like software updates and changes in systems can be
easily made, with no need to change what had previously been implemented. One possible
solution to this problem is the use of component-based programming languages.
This kind of programming languages tries to promote not only code reuse but also a
black-box discipline where it is not needed how a service is implemented, but only its
interface so that it can be used.
The ComponentJ programming language seeks to provide a simple way to perform
component creation and composition, making this new programming paradigm somewhat
easy to use. Because ComponentJ is meant to be an extension to the Java programming
language it becomes possible to implement components using the whole
expressiveness of this language. It is also possible, in ComponentJ, to dynamically
change components and the object structure based on runtime decisions. This dynamic
reconfiguration process allows, for instance, to perform changes/updates to a certain
software system without having to stop its execution.
The goal for this project is to implement a type system for the ComponentJ programming
language, based on the work presented in [32, 28]. Type verification is
syntax driven, and uses structural equivalence of types. Advanced techniques such
as subtyping and type inference are also included in order to make the language more
flexible. Besides the static type checker, a dynamic checker is also included, allowing
the type safe application of runtime changes to the system (dynamic reconfiguration
of objects) before their application