Problem:
Different Versions of applications need to be dynamically loaded in the system, mainly because of interface changes.
Solution:
1. Switch the view in clearcase to select different versions.
2. Remove this app from the control of clearcase. Different versions are differentiated by different directories.
Feasibility analysis phase:
The first solution was quickly abandoned. A single user switched views well, but the system was a multi-user. There was no effective way to control the apps under multiple views: (if anyone knows, please tell me :)
-------------
APP (viewb), user1
For example, modulea (viewa) ------------- app (viewc), user2
The second solution is feasible.
The main idea is to make this app independent from the version control of clearcase, which does not need to be switched in different views. The system only needs to dynamically load the app in the corresponding path based on the version specified by the user. It can be used to detect the version change of the app in clearcase and create the corresponding path, is not part of the system.
The characteristics of dynamic loading in Erlang mainly in the Code module, detailed can refer to the http://www.erlang.org official explanation. This module is mainly an interface provided by code server and is responsible for beam File Path Management in the Erlang system.
For specific problems, the idea is as follows:
If the system already contains the module path, uninstall it: code:Del_path
Load the new path code: add_path, and then update code: rehash.
In addition, when starting with ERL, do not use PZ to include the path of this module, which may lead to invalid (not carefully studied). We recommend that you use this dynamically specified method.
After updating the module path, you can use it normally.
PS:
You need to delete the module and use code: delete. I used init: Stop to kill this node for easy reasons, so I don't need :)