Implementing method and device and calling method and device for private method under programming environment

A programming environment and implementation method technology, applied in the computer field, can solve the problems of code logic and program call confusion, program stability and security risks, etc., to ensure the effect of running performance

Active Publication Date: 2018-11-02
ADVANCED NEW TECH CO LTD
View PDF6 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] (1) Due to the language characteristics of this programming environment, the language itself does not provide private methods, so the "private methods" hidden in the above method may still be accidentally called by external callers through forward declarations, which may There may be confusion in code logic and program calling, and there may be risks in program stability and security
[0007] (2) Class "inheritance" will be frequently used in development. At this time, the "private method" declared in the above method is still a public method in essence, so the subclass may use the parent method without knowing it. The "private method" declared in the class is declared again, so the "private method" declared in the parent class will be overwritten by the "private method" declared in the subclass, and the "method coverage problem" in program development occurs

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
  • Implementing method and device and calling method and device for private method under programming environment
  • Implementing method and device and calling method and device for private method under programming environment
  • Implementing method and device and calling method and device for private method under programming environment

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0064] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and corresponding drawings. Apparently, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

[0065] In view of the fact that Objective-C is a very typical programming environment that lacks private method solutions, the following embodiments take the declaration, implementation, calling methods and devices of private methods under the Objective-C mechanism as examples, and illustrate the application in conjunction with the accompanying drawing...

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 an implementation method, an implementation device, a calling method and a calling device for a private method under a programming environment. The implementation method comprises the steps of when the first private method carries a pointer of a class instance, stating the first private method in a class according to a static method of a programming language, wherein parameters of the statement of the first private method comprise a pointer of the class instance of the first private method; and implementing the private method according to a function implementation method of the programming language. When implementation of the first private method needs to access a private variable, the first private method also can be implemented by using a pointer access protector.The invention also discloses the calling method for the private method. The calling method comprises the step of using a function type converter to convert the first private method into a programmingenvironment method for calling, wherein the parameters of the function type converter comprise a function pointer of the first private method, a name identifier of the first private method, and a type identifier of the class to which the first private method belongs. According to the methods and devices provided by the invention, true sense of privatization of the private method under the programming environment is achieved under the premise of ensuring calling performance.

Description

technical field [0001] The present application relates to the field of computer technology, in particular to a method for realizing a private method in a programming environment, a calling method and a device thereof. Background technique [0002] With the development of computer technology, more and more programming languages ​​and programming environments have emerged. Some programming languages ​​and programming environments support the privatization of methods and variables, such as Java and JavaScript, and some programming languages ​​and programming environments do not, such as Objective-C. The following uses Objective-C as an example to illustrate the problems that exist in this type of programming environment that does not support private methods and private variables. [0003] Objective-C (also referred to as OC for short) is a computer language that can support true object-oriented programming. Objective-C extends the standard ANSIC language by providing syntax f...

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/448G06F8/30
CPCG06F8/315
Inventor 范伟
Owner ADVANCED NEW TECH 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