Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method for solving the problem of too many software branch statements

A branch and statement technology, applied in the field of software design, can solve problems such as inconvenient software maintenance, too many main function branches, and difficult maintenance, and achieve the effects of improving readability, enhancing scalability, and simplifying program structure

Inactive Publication Date: 2016-06-15
成都卫士通信息产业股份有限公司
View PDF4 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In this type of system, the biggest code works in the third step, which is to call different processing functions according to different commands. The usual design will use switch branch function or function pointer array for processing. If switch branch statement is used for processing , will cause the main processing function to contain more branches, which will require modification of the main processing function to add branch content when the function is expanded, which is difficult to maintain and not conducive to reading, and will also cause inconvenience to the later maintenance of the software
If the function pointer data is simply used for processing, the problem of too many main function branches can be solved, but when the function is expanded, the main processing function module also needs to be modified, which is difficult to maintain

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
  • Method for solving the problem of too many software branch statements

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0029] The design idea of ​​the present invention is: the combination of dynamic library and function pointer data, to solve the problem when there are many branch statements in the above-mentioned software engineering, to simplify the software structure, improve the efficiency of software design, and improve the readability, maintainability and maintainability of the software scalability.

[0030] The present invention can be divided into three big steps:

[0031] a. Dynamic library building steps.

[0032] b. Steps for establishing function pointers.

[0033] c. The function pointer points to the dynamic library step.

[0034] Combine below figure 1 Describe each step in detail. Among them, dll is a dynamic library, pcmd is a function pointer, Mngcmd is a unified processing function, and SCMD is an array of function functions.

[0035] The dynamic library building steps specifically include the following steps:

[0036] Step 1: Create a dynamic library dll, and compile...

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 discloses a method for solving too many branch statements in software, which comprises: the step of establishing a dynamic library; the step of establishing a function pointer; and the step of pointing the function pointer to the dynamic library. The invention combines the dynamic library and function pointer data to solve the problem of many branch statements in the above software engineering, to simplify the software structure, improve the software design efficiency, and improve the readability, maintainability and expandability of the software.

Description

technical field [0001] The invention belongs to the technical field of software design, and in particular relates to a method for solving excessive branch statements in software. Background technique [0002] Architecture design is an important step in software design. An excellent architecture design can ensure the stability, scalability, and maintainability of the entire software system. [0003] In the design of software systems, especially communication systems, the following processing logic often appears: 1. Communication data frame reception -> 2. Analyze the data -> 3. Call different processing functions according to different commands -> 4. Send processing results. [0004] In this type of system, the biggest code works in the third step, which is to call different processing functions according to different commands. The usual design will use switch branch function or function pointer array for processing. If switch branch statement is used for processing ...

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
IPC IPC(8): G06F9/44
CPCG06F8/22
Inventor 赵银春
Owner 成都卫士通信息产业股份有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products