Font Size: a A A

Method Of Software Dynamic Evolution Based On Reflection Technology

Posted on:2008-04-17Degree:MasterType:Thesis
Country:ChinaCandidate:T YanFull Text:PDF
GTID:2178360212997012Subject:Computer software and theory
Abstract/Summary:PDF Full Text Request
At present, a large number of applications are running on an open Internet,dynamic and volatile environment, where the hardware resources and customer requirement frequent changes. They have to adjust their behavior to deal with the new information objects, be stretching their capacity to adapt to the task environment and requirements may be changing. To meet these requirements, the applications must have the ability of software evolution to change the composition component dynamically, and adjust their internal structure. The mission-critical system such as banking system, e-commerce system, telecommunication exchange system and weapon control system have to supply service in the form of 7×24×365, but they are also unable to avoid the problems like upgrade and bugs. Software Evolution includes the following four categories:1. Design-time Evolution: Design-time Evolution is the most widely used form of evolution in the software development practice. In the design, along with the deepening of the understanding of the system, the framework has become increasingly clear, perfect, That in itself is a process of change in the system architecture. At this time evolution is an abstract model of the system was changed;2. Pre-execution Evolution: Also known as passive evolution, It's the evolution after compile and before operation. Generally reflected in recompiling the varying parts code of the system, or reconfiguration of the software;3. Constrained Runtime Evolution: Also known as the safe mode run-time evolution, the system operates on the "safe mode". The evolution is restricted to the extent. The system must provide the mechanism to preserve the current structure information and dynamic evolution;4. Dynamic evolution: Dynamic evolution refers to that the system dynamically configure, maintain and refresh the software based on the application requirement and environment change, the represent form contains the changeability of system element number, the Adjustability of structure relationship, the dynamic configurability of structure form.In practical application, the dynamic evolution of software is the most practical significance, in the study of evolution, there are many methods have been proposed, such as solution based on hardware redundancy, solution based on graph, solution based on C2 architecture, solution based on accessibility matrix, solution based on logic specification and so on. In this paper they are introduced in detail.These solutions are made from the logic level. This paper will come up with a software dynamic evolution method based on reflection technology from the implementation level. The dynamic-link technology is frequently used in the implementation process of software dynamic evolution. Dynamic link is a relative term of the static link. The so-called static link refers to the calling function or procedure link to executable files, and become a part of them. In another word, the codes of function or procedure are right in the executable files, and the files contain all the codes needed for execution. When a number of programs call the same function, there are a number of copies of this function in the memory. The function codes called by the dynamic link are not been copied to the executable files, but just add some description information to them. Only if the application has been loaded into memory and started running, the link relation between the application and dynamic library is created.This characteristic happens to provides support for software dynamic evolution. For example: some functions of software can be encapsulated to dynamic libraries. If the function of software needs to be changed, just replace the libraries. However, in the traditional dynamic-link technology, the interfaces should be defined before development. Even if the libraries are replaced, the interfaces can not be changed dynamically. Reflection technology can solve this problem. Reflection is a very important technology in dot net platform and JAVA. Its nature is to review the meta-data after compiled, to get the information in assembly and class. By using reflection, an object can be created dynamically by name and the methods of the class can be also got dynamically. If the dynamic link technology combined with the reflection technology, the software system will have the"self-described"characteristic to apperceive the external change and do the corresponding adjustment and evolution.This paper describes the principle of this method and realization process.,and verifies the feasibility through an example. This example assumes calculating the salary according to the different algorithm for employees on different job positions, that is, the salary calculation policies are different. The ultimate goal of this system is to calculate salary for employees on different positions by loading the different salary calculation policy modules, also to supports the addition of new policy and deletion of old policy. In the process of realization, reflection technology is fully utilized. For each kind of salary calculation policy, the objects are created dynamically, and the functions in the class are dynamically got and called. This enables the system to minimize the degree of coupling, and thereby achieve the dynamic evolution of software purpose.In the process of realization, some necessary strategy is needed in the design phase, such as Isolation Strategy. The example in this paper uses this strategy to separate the frequent change part and the relatively stable part, and the reflection is used to assemblies in the frequent change part.The following steps show how to realize the system: Step1: Carefully analyze the current system at the design phase, and separate the business module and the framework part;Step2: Extract the public characteristics of the business modules, and design them to be interfaces, which take responsibility for the interaction of the two parts. Each part should interact with the other one through the interface;Step3: Design the business module, the framework, the interface each to be an assembly;Step4: The assembly of the business module takes the dynamic loading, when loaded successfully, the framework uses the reflection to create object dynamically, and get the class information to realize business flow.In accordance with the above steps, the component can be smoothly replaced in the system, thus achieved the purpose of the software dynamic evolution. This paper is mainly focus on how to add and replace the components, without affecting the function. The state preservation issues and so on are not been considered, they will be my future task to complete.
Keywords/Search Tags:Reflection
PDF Full Text Request
Related items