A method of realizing custom development based on classloader

A development stage, project technology

Active Publication Date: 2020-04-24
百卓网络科技有限公司
View PDF14 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] (2) The amount of development and maintenance will be huge
For example, when common codes such as new product features and bug fixes are maintained, the maintenance cost of these branch versions will increase exponentially!
[0006] (3) Complicated testing and release
It is inefficient and error-prone to obtain the corresponding branch code, packaging, testing, etc. for different customers.
[0007] According to the customization needs of users in different sub-sectors, there are usually two methods currently adopted, one is branch development, and the other is plug-in mode; the branch development refers to the development of a branch, and carry out customized development on this branch; however, as the number of enterprises increases, the number of branches will gradually increase, which will undoubtedly bring huge overhead costs to later maintenance and upgrades; the plug-in development mainly includes script-based, etc. Dynamic interpretation language and extension based on a specific plug-in interface. The former mainly uses the ability of dynamic interpretation and execution of scripting language. Since the scripting language does not need to be compiled, there is no need to construct types in advance. It only needs to be dynamically interpreted and executed each time it is called. For development It is convenient to adjust the program logic, but the program execution efficiency is poor, and it is almost suitable for scenarios where the expansion requirements are not complicated; the latter supports more complex business logic, and generally writes some components that follow certain rules. Or when executing specific business logic, load the type in the component by static call or reflection, etc. and execute the corresponding code, and pass the address of the exposed extension interface in memory to the component, and the component calls the plug-in interface according to these addresses, so as to realize Enhancements to main program functionality
Plug-in development is a method that is widely used at present, but it is limited to add new functions on the basis of the original service interface and plug-in interface, and cannot change the original functions. It can only be regarded as an add-on
[0008] In order to solve the frequent modification of the program to meet the constantly updated business needs, the patent "plug-in support method based on preloading mechanism" (application number: 201510136737.0) has made a new breakthrough, including the following steps: 1. The main program starts and Load the plug-in running framework, which is responsible for reading the external plug-in; 2. The plug-in running framework starts an independent class loader for the external plug-in, and the class loader loads the type in the plug-in and saves the type in the global cache; 3. Plug-in Run the framework to obtain the current class loader of the main program, replace the parent loader of the current class loader of the main program with the proxy class of the original parent loader, and the proxy class of the original parent loader will intercept all the requests sent to the original class loader Type loading call; 4. When the main program requests to call the Class type, first search for the Class type from the original parent loader according to the type name, if the target type is not found, then match from the global cache to see if there is a corresponding type provided by the plug-in , if the matching is successful, it will be directly loaded and executed, otherwise, an exception will be thrown; however, this patent only uses a supplementary mechanism to meet new needs by continuously adding functions. Although it can cope with customized development, it is not compatible. And the stability of program replacement is not considered comprehensively

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method of realizing custom development based on classloader

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0023] In order to allow those skilled in the art to better understand the technical solutions in the examples of the present application, the technical solutions of the present invention in the implementation of the present application will be further described below in conjunction with the accompanying drawings.

[0024] figure 1 In the embodiment of the present invention, it is a schematic flow diagram based on ClassLoader to realize customized development, and the specific flow includes:

[0025] Step 101: Based on the existence of the existing general system or page, according to the individual needs of each user, customize and develop an independent J2EE project, build custom classes according to the custom business logic, and place the custom classes in the new J2EE project , and choose whether to inherit the original class according to business needs, and mark the customized class with "annotation @AepsCustomize";

[0026] Step 102: For the static resources with custo...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to a method for realizing customized development based on a ClassLoader. Product design and implementation of an e-commerce platform are based on the customization of a project with a J2EE framework. The method comprises the steps of (1) newly building the project with the J2EE framework on the e-commerce platform according to individual demand; (2) compiling the new project obtained in the step (1); (3) packaging the new project with the J2EE framework into a war package, publishing the war package to an application server, and changing the name suffix of the war package into plg or other tasks; when an application begins to load the classes in the business war package, using the pre-programmed ClassLoader to firstly load static resources in the customized war package.

Description

technical field [0001] The invention belongs to the technical field of java development, and in particular relates to a method for realizing custom development based on ClassLoader. Background technique [0002] ClassLoader is a class loader used to dynamically load class files into the virtual machine. When a class loader loads a Class, all the Classes that the Class depends on and references are also loaded by the ClassLoader. The process of ClassLoader loading class includes: (1) find the .class file and load this file into the memory; (2) bytecode verification, class class data structure analysis, memory allocation and symbol table link; (3) in the class Static properties and initialization assignments and execution of static code blocks. [0003] The product planning, design and implementation on most e-commerce platforms are mainly to meet the general needs of most enterprises, and do not deal with the differences in some business operations or processes in the detail...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F8/20G06F8/30G06F8/38G06F8/60G06F9/445
CPCG06F8/24G06F8/315G06F8/38G06F8/60G06F9/44521
Inventor 陶富成
Owner 百卓网络科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products