Figure shows a code example for the invocation of a method of the class Memory. Before the method invocation the class must be loaded and instantiated explicitly through the adaptation mechanism m_adaptation.
The member variable m_adaptation holds a reference to an object of the class Adaptation. The class Adaptation provides a method loadImplementationClass(String) which returns the appropriate class for the environment.
When the agent migrates to a new host, it drops the implementation class and re-creates an implementation class in the new environment. The mobile code does not carry the implementation class to the new environment for the case that the implementation class is not needed on the new host. Figure shows this concept where on every host the implementation classes must be explicitly re-created by the mobile agent.
This solution would implicate that adaptation is not transparent for the core:
A second disadvantage is the loading of the implementation class by specifying the functionality interface during runtime as a string. If a non-existing interface name is specified, the error can only be detected during runtime. This is contradictory the requirement R4. An improved level of transparency can be achieved by the following approach.