Dependency injection method, device, device and storage medium

A dependency injection and dependency relationship technology, applied in the field of program development, can solve problems such as slow response, user-side freezing, time-consuming, etc., and achieve the effect of avoiding freezing

Active Publication Date: 2022-04-05
GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF6 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] However, a large amount of reflection processing will be very time-consuming and resource-intensive. After the user starts the application, when the application performs a large amount of reflection processing, it will cause abnormal conditions such as user-side freezing and slow response.
[0004] Therefore, the current dependency injection method has the problem that the program running causes the client to be abnormal.

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
  • Dependency injection method, device, device and storage medium
  • Dependency injection method, device, device and storage medium
  • Dependency injection method, device, device and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0061] figure 1 It is a flowchart of a dependency injection method provided in Embodiment 1 of this application.

[0062] The dependency injection method provided by this embodiment can be executed by a program development end, which can be realized by software and / or hardware. The program development end can be composed of two or more physical entities, or can be a physical entity Entity composition.

[0063] First of all, it needs to be explained that an application program can contain multiple modules, and there are dependencies between modules. Such dependencies may cause program instability in large applications. For example, when a certain module A depends on module B, the modification of module B will cause module A to be modified accordingly, or the behavior of module A will also need to be changed accordingly. As the functions of the application program increase, the application program will have more and more modules, and the dependencies between the modules will ...

Embodiment 2

[0086] Figure 4 It is a flow chart of a dependency injection method provided in Embodiment 2 of this application. The dependency injection method provided in this embodiment can be executed by the program development end, and specifically includes:

[0087] Step S210, when compiling the program, determine the core compiling task of the compiling task.

[0088] Wherein, the core compiling task may be a compiling task of converting a source code file into an application program or a library.

[0089] In a specific implementation, program compilation is composed of a large number of compilation tasks, including the compilation task of converting source code files into application programs or libraries, which is taken as the core compilation task.

[0090] Step S220, before executing the core compiling task, collecting source code files.

[0091] In the specific implementation, there is an execution order between different compilation tasks, and the core compilation task is to ...

Embodiment 3

[0117] Figure 7 It is a schematic structural diagram of a dependency injection device provided in Embodiment 3 of the present application. refer to Figure 7 , the dependency injection device provided in this embodiment specifically includes: a file collection module 310, a file parsing module 320, a code generation module 330, and a program generation module 340; wherein:

[0118] A file collection module 310, configured to collect source code files when compiling the program;

[0119] A file parsing module 320, configured to parse the source code file to obtain dependency features;

[0120] A code generation module 330, configured to generate the dependency code of the dependency feature;

[0121] The program generation module 340 is configured to generate an application program according to the source code file and the dependency code, so that when the user terminal runs the application program, it executes the dependency code to obtain the dependency relationship of th...

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 present application relates to a dependency injection method, apparatus, device and storage medium. The method includes: collecting source code files when compiling a program; parsing the source code files to obtain a dependency relationship feature; generating a dependency relationship code of the dependency relationship feature; according to the source code file and the dependency relationship code to generate an application program, and when the user terminal runs the application program, execute the dependency relationship code to obtain the dependency relationship of the application program. According to the embodiments of the present application, the problems of the user terminal being stuck and slow in response caused by the reflection processing performed by the user terminal when running the application program are avoided.

Description

technical field [0001] The present application relates to the field of program development, in particular to a dependency injection method, device, equipment and storage medium. Background technique [0002] In application development, dependency injection is mainly used to solve the dependency problem between different modules. Dependency injection is currently implemented through reflection processing. When the application program is running, metadata information of the application program can be collected through reflection processing, and the dependencies among various modules in the application program can be determined according to the metadata information. [0003] However, a large amount of reflection processing will be very time-consuming and resource-intensive. After the user starts the application program, when the application program performs a large amount of reflection processing, it will cause abnormal conditions such as user-side freezing and slow response. ...

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/41
CPCG06F8/427G06F8/433
Inventor 吕毅
Owner GUANGZHOU SHIYUAN ELECTRONICS CO LTD
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