CN108595160A - JS calls the method for primary object, storage medium - Google Patents
JS calls the method for primary object, storage medium Download PDFInfo
- Publication number
- CN108595160A CN108595160A CN201810466934.2A CN201810466934A CN108595160A CN 108595160 A CN108595160 A CN 108595160A CN 201810466934 A CN201810466934 A CN 201810466934A CN 108595160 A CN108595160 A CN 108595160A
- Authority
- CN
- China
- Prior art keywords
- primary
- class
- proxy
- instances
- calls
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/315—Object-oriented languages
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Stored Programmes (AREA)
Abstract
The present invention provides a kind of JS and calls the method for primary object, the storage medium, method to include:A primary class pond, a primary Instances Pool and primary proxy program is respectively created in primary layer, and maps that JS layers, obtains corresponding JS class pond, a JS Instances Pool and JS proxy programs respectively;The request of the example of the corresponding primary module of establishment is initiated to JS proxy programs in JS layers;JS proxy programs send the establishment parameter for the example for including in request to primary proxy program;Primary proxy program creates the primary example of a corresponding primary module according to the establishment parameter in primary Instances Pool, and maps that in JS layers of JS Instances Pools.The present invention can realize the parallel calling asked distinct interface, significantly shorten the interface requests time, solve the problems, such as interface interim card, improve the experience of user.
Description
Technical field
The present invention relates to application development field, particularly relates to a kind of JS and the method for primary object, storage is called to be situated between
Matter.
Background technology
In the prior art, App that can be based on React-native Development of Framework iOS, Android platform.React-
Native frames (hereinafter referred to as frame) are the cross-platform mobile application Development Frameworks that Facebook increases income in April, 2015, are
The UI frames React that Facebook increases income previously supports iOS and Android two at present in the derivative products of primary mobile solution platform
Large platform.Frame is supported to pass through one primary app of JS code establishings.For the unencapsulated platform api of frame, developer is supported
It is called according to the self-defined primary module of rule, then by JS.Briefly, it is exactly primary offer sdk, JS calling sdk realizations
Function.
Frame can be mapped to primary module in a JS layers of upper primary module pond that (frame official document is using saying at present
Bright http://facebook.github.io/react-native/docs/native-modules-ios. html), JS layers are former
Each object in raw module pond can correspond to a primary module.Both ends are one-to-one relationships.Frame acquiescence
Mapping relations are as shown in Figure 1.The shortcomings that this one-to-one pattern is exactly can not be easily in the same React Native page
There are the scenes of multiple equal modules for surface treatment.
Such as following situation:
Scene:One page includes carousel figure, movie listings, and the data source of carousel figure, movie listings is in different
Interface requests.
The data of carousel figure and movie listings need to obtain by different interfaces, if only existing an interface module,
So need in order that (interface module here corresponds to the interface module of primary customization to calling interface module, can be to the knot of request
Structure and the data of return are formatted processing, can also increase some and ask relevant field, such as type), previous interface is asked
The latter interface requests are retransmited after asking return, are passed to different parameter acquiring data.Interface requests need the time, if increased again
Add several distinct interfaces, the time of request of data is longer, interface interim card, to the experience of user with regard to bad.
Therefore, it is necessary to which providing a kind of JS that can be solved the above problems calls the method for primary object, storage medium.
Invention content
The technical problem to be solved by the present invention is to:A kind of JS is provided and calls the method for primary object, storage medium, it can
It supports to carry out parallel work-flow by multiple examples of JS pairs of primary module.
In order to solve the above-mentioned technical problem, the technical solution adopted by the present invention is:
A kind of method that JS calls primary object, including:
A primary class pond, a primary Instances Pool and primary proxy program is respectively created in primary layer, and is reflected
JS layers are mapped to, obtains corresponding JS class pond, a JS Instances Pool and JS proxy programs respectively;
The request of the example of the corresponding primary module of establishment is initiated to JS proxy programs in JS layers;
JS proxy programs send the establishment parameter for the example for including in request to primary proxy program;
Primary proxy program creates the original of a corresponding primary module according to the establishment parameter in primary Instances Pool
Raw example, and map that in JS layers of JS Instances Pools.
Another technical solution provided by the invention is:
A kind of computer readable storage medium is stored thereon with computer program, and described program is when being executed by processor
It can realize all steps that the method that above-mentioned JS calls primary object is included.
The beneficial effects of the present invention are:The present invention creates primary class pond and original for storing class and example in primary layer
Instances Pool is given birth to, and the proxy program that can be operated to all classes, and be based on JS prototype principles, synchronous will created at JS layers
Go out JS classes pond corresponding with primary layer, JS Instances Pools and proxy program;User can correspond to any one class, pass through proxy program
Multiple examples is created, and is stored in Instances Pool, each example is mutually isolated, is independent of each other;It thus just can be by JS
Jie's module is transmitted to method call of the primary proxy program to primary example to the method calls of JS examples.The present invention extends
Modes of operation of the JS to primary module supports the multiple examples for creating by JS primary module, and data between different instances
Isolation, does not interdepend, therefore supports the parallel calling by JS to primary example, to realize based on React-
On the page of native, the parallel work-flow to distinct interface, and then the interface requests time is significantly shortened, it solves interface interim card and asks
Topic, optimizes user experience.
Description of the drawings
Fig. 1 is the mapping relations schematic diagram that the frame of the prior art is given tacit consent to;
Fig. 2 is the flow diagram that the JS of the present invention calls the method for primary object;
Fig. 3 is the primary layer and JS layers of mapping schematic diagram of the present invention;
Fig. 4 is the mapping relations schematic diagram of the example and class of the present invention;
Fig. 5 is the initialization flow diagram of embodiment one;
Fig. 6 is the method call flow diagram of embodiment one;
Fig. 7 is the example visioning procedure schematic diagram of embodiment one;
Fig. 8 is that the example of embodiment one deletes flow diagram;
Fig. 9 is the single-instance method call overall flow schematic diagram of embodiment one;
Figure 10 is that the class instance method of embodiment one calls overall flow schematic diagram;
Figure 11 is the primary layer and JS layers of overall architecture schematic diagram of embodiment one.
Specific implementation mode
To explain the technical content, the achieved purpose and the effect of the present invention in detail, below in conjunction with embodiment and coordinate attached
Figure is explained.
The design of most critical of the present invention is:Class pond, Instances Pool and proxy program is respectively created in primary layer and JS layers, can be with
Easily create the example of multiple identical primary classes by proxy program, and it is mutually isolated operate, to realize interface
Parallel work-flow.
Explanation of technical terms of the present invention:
Fig. 2 to Fig. 4 is please referred to, the present invention provides a kind of method that JS calls primary object, including:
A primary class pond, a primary Instances Pool and primary proxy program is respectively created in primary layer, and is reflected
JS layers are mapped to, obtains corresponding JS class pond, a JS Instances Pool and JS proxy programs respectively;
The request of the example of the corresponding primary module of establishment is initiated to JS proxy programs in JS layers;
JS proxy programs send the establishment parameter for the example for including in request to primary proxy program;
Primary proxy program creates the original of a corresponding primary module according to the establishment parameter in primary Instances Pool
Raw example, and map that in JS layers of JS Instances Pools.
As can be seen from the above description, the beneficial effects of the present invention are:The present invention program is based on React-native frames, expands
Opened up modes of operation of the JS to primary module, supported the multiple examples for creating primary module by JS, between different instances data every
From not interdepending, can be operated parallel, optimize user experience.
Further, a primary module is corresponded to, corresponding multiple primary examples are stored in the primary Instances Pool.
Seen from the above description, it need to can only be realized by the way that multiple examples of primary module are stored in primary example
Parallel work-flow to multiple examples.
Further, further include:
The request of the corresponding example of described one primary module of calling is initiated to JS proxy programs in JS layers;
JS proxy programs send the call parameters for the example for including in request to primary proxy program;
Primary proxy program obtains an example according to the call parameters from primary Instances Pool, and calls described one
The corresponding method of example.
Seen from the above description, can be made by the transmission that JS layers and all existing proxy program of primary layer play bridge
With the calling that realization is initiated by JS layers to primary example, directly in operation to primary example.
Further, the request for initiating to create the example of a corresponding primary module to JS proxy programs in JS layers,
Before, including:
Primary proxy program according to a primary module add respectively corresponding primary class and primary example to primary class pond and
Primary Instances Pool, and it is respectively mapped to JS layers of JS classes pond and JS Instances Pools.
Seen from the above description, a class corresponding with primary injection class is created that according to the prototype principle of JS at the ends JS
Pond, Instances Pool corresponding with primary example and proxy program provide basis for the parallel work-flow subsequently based on the ends JS.
Further, further include:
The request of the corresponding example of deletion is initiated to JS proxy programs in JS layers;
JS proxy programs send the instance identification for the example to be deleted for including in request to primary proxy program;
Primary proxy program is searched in primary Instances Pool according to the instance identification and deletes corresponding primary example.
Seen from the above description, it supports when confirmation does not use an example, the mode for deleting primary example is provided, it is convenient
Data management and the optimization for realizing storage data.
Further, between each JS classes in each primary class and JS classes pond in the primary class pond, described
It is carried out pair by unique identifier between each JS examples in each primary example in primary Instances Pool and JS Instances Pools
It answers.
Seen from the above description, the prototype principle based on JS, JS layers contain from primary layer and reflect incoming content, and two
It is mapped between person by uniquely identifying, it is ensured that one-to-one relationship, to realize by the calling to JS examples, directly
It operates on primary example.
Further, further include:
When application program launching, the class set for realizing grouting socket is obtained;
Each class in the class set is traversed, judges whether the class currently traversed realizes establishment interface, if so,
The class currently traversed is preserved into primary class pond;If it is not, then creating the example of the corresponding class currently traversed, and deposited
In storage to primary Instances Pool.
Seen from the above description, it by above-mentioned APP initialization procedures, realizes and the efficient classification of all classes of grouting socket is deposited
Storage provides support for the accurate calling subsequently based on class pond and Instances Pool.
Another technical solution provided by the invention is:
A kind of computer readable storage medium is stored thereon with computer program, and described program is when being executed by processor
It can realize all steps that the method that above-mentioned JS calls primary object is included.
As can be seen from the above description, the beneficial effects of the present invention are:It corresponds to one of ordinary skill in the art will appreciate that real
All or part of flow in existing above-mentioned technical proposal, is that relevant hardware can be instructed to realize by computer program
, the program can be stored in a computer-readable storage medium, and the program is when being executed, it may include such as above-mentioned each
The flow of method.
Embodiment one
Fig. 2-Figure 11 is please referred to, the present embodiment provides a kind of JS based on React-Native frames to call primary object
Method.The present embodiment is expanded on the basis of creating the primary module pond for having corresponding primary module on the JS layers of the prior art
Exhibition, can realize and be called to example by JS layers, can directly be operated on primary example, and then realize in Instances Pool
Multiple primary examples carry out parallel work-flows, the i.e. multiple interfaces of parallel work-flow, thus shorten the time of request of data, solve boundary
Face interim card problem optimizes user experience.
The method of the present embodiment may include:
One, the early-stage preparations stage:
A primary class pond, a primary Instances Pool and primary proxy program is respectively created in primary layer, and is reflected
JS layers are mapped to, obtains corresponding JS class pond, a JS Instances Pool and JS proxy programs respectively.
Specifically, as shown in figure 3, creating a class pond, i.e., primary class pond, for preserving primary class in primary layer;Wound
Build an Instances Pool, i.e., primary Instances Pool, for preserving primary example;Be respectively created at JS layers one it is corresponding with primary layer
Class pond and Instances Pool carry out mapping correspondence between them by a unique mark.It is illustrated in figure 4 the mapping of example and class
Relation schematic diagram passes through a unique mark between each JS classes in each of that is, primary class pond primary class and JS classes pond
It is corresponded to, it is unique by one between each JS examples in the primary example of each of primary Instances Pool and JS Instances Pools
Identifier is corresponded to.The class that a custom block can be corresponded in Instances Pool is stored with multiple examples, and each example
Independently of each other, the parallel calling for multiple examples provides support.Developer can directly be operated by the calling to JS examples
On primary example.
A proxy program is respectively created in primary layer and JS layers, bridge beam action is played, for safeguarding custom block
The establishment of (primary module) and calling.The proxy program, can be into all classes by increasing by one in constructed fuction
The module of row operation is realized.By calling the establishment Instance Interface of proxy program, can be created in primary Instances Pool corresponding
Example, to provide branch, to the method call of example, to be eventually transferred into the realization to the method call of primary example by JS
It holds.
Method call is to transmit instance identification, method name, parameter etc. by calling the method for JS proxy programs, final to adjust
The method for using primary proxy program, then by primary proxy program call on specific example method (here we not
It needs to be concerned about that the method for the same name for how realizing that the method for calling JS proxy programs can call the primary module of correspondence, frame have been done
It is good).
It, can be to lead to for follow-up realize by the establishment of above-mentioned primary layer and JS layers of class pond, Instances Pool and proxy program
It crosses and accesses to the example after establishment in JS, can operate on primary example, and multiple phases can be created simultaneously
With the example of primary class, between example the parallel work-flow of mutually isolated ground technical support is provided.
Two, the last stage is called:
1, a grouting socket is defined, needs to realize a method for returning to mark;An establishment interface is defined, reality is needed
The method of an existing initiation parameter.Wherein, the mark that grouting socket returns, which is used for distinguishing, searches the class specifically to be called, creates
The method of the initiation parameter of interface transmits specific characteristic value when for creating different instances.
2, when App starts, all classes for realizing grouting socket are obtained;Then ergodic classes, if this currently traversed
A class also achieves establishment interface, then this class is saved in primary class pond;Otherwise, such example is created, is preserved
Into primary Instances Pool.Specific steps flow is as shown in Figure 4.
Wherein, it during class and example are stored to corresponding primary class pond and primary Instances Pool, needs with can be only
One corresponds to an identifier of class or example as class or the mark of example, and such as key, Key correspond to a mark, for positioning differentiation not
The class of congenerous, for example, network module we can define and be identified as ' network '.
By the step, initialization is realized, all grouting sockets in React-Native frames are all subjected to consolidation,
It stores to corresponding pond, precision ratio when specified class or example is searched based on pond when to improve subsequent calls, to improve this
The probability of success that embodiment interface calls.
3, can by proxy program realize interface call method invoke, example create method newInstance,
And the method deleteInstance that example is deleted.
Wherein, as shown in fig. 6, primary proxy program realizes that the process description for the method invoke that interface calls is as follows:
(1) proxy program is passed to the corresponding instance identification of the interface to be called, method and parameter;
(2) example of corresponding instance mark is searched in Instances Pool;If being not present, report an error, terminates;
If in the presence of the method for calling the example specified is passed to method parameter;
(3) it returns the result, terminates.
Wherein, as shown in fig. 7, proxy program realizes that the process description for the method newInstance that example creates is as follows:
(1) proxy program is passed to the identifying of the example to be created, the mark and parameter of corresponding class;
(2) class of the mark of corresponding class is searched in class pond;If being not present, report an error, terminates;If in the presence of establishment pair
Should class example, and according to parameter initialization data;
(3) search whether that there are corresponding examples in Instances Pool according to the mark of example;If in the presence of preserving, terminating;
If being not present, example is preserved to Instances Pool, using key as instance identification, is terminated.
Above-mentioned Instances Pool, class pond refer both to primary Instances Pool and primary class pond.
Wherein, as shown in figure 8, proxy program realizes the process description for the method deleteInstance that example is deleted such as
Under:
(1) proxy program is passed to the mark of the example to be deleted;
(2) example that the mark of corresponding examples detailed above is searched in Instances Pool reports an error if being not present, and terminates;If depositing
The example is then being deleted in primary example, is being terminated.
4, primary proxy program obtains the method list of all injection classes, exports in corresponding variable and (specifically how to lead
Go out, can refer to the constant deriving method http of frame support://facebook.github.io/react-native/docs/
Native-modules-ios.html#Exporting%20C onstants).
5, the interface acquisition methods list that JS proxy programs are called in JS layers, according to derived instance identification name and method
List creates object of the same name at the ends JS, and to object adding method, (specific implementation of this method is exactly the invoke for calling intermediary
Call method);Then according to the principle that derived class identifies method name list information, based on JS prototypes, dynamic creation is of the same name
Class, and in the prototype of JS classes (prototype) create counterparty's religious name method.The example and class of establishment are saved in respectively
In JS Instances Pools, JS classes pond.
The step is realized the content correspondence mappings in primary class pond and primary Instances Pool from primary layer in JS layers
In JS classes pond and JS Instances Pools.
Three, the stage is specifically called
Based on above-mentioned basis, developer can obtain example from JS Instances Pools, and corresponding method is called to realize to primary
The method call of example.
Wherein, the calling overall flow of single-instance method:
Specifically, as shown in figure 9, may comprise steps of:
1, primary proxy program obtains relevant information from a custom block, i.e., one primary module;
2, primary proxy program creates corresponding example according to acquired information in primary Instances Pool;
3, primary proxy program exports the method information of created example to JS proxy programs;
4, method information creating corresponding JS object of the JS proxy programs according to the example received, i.e. JS examples, and
It is stored in JS Instances Pools;
5, developer obtains above-mentioned JS examples by service code from JS Instances Pools;
6, developer is sent using service code calls the corresponding method of JS examples to JS proxy programs;
7, JS proxy programs initiate the call request of the method for the corresponding JS examples to the primary proxy program of primary layer;Please
Include the call parameters of the JS examples in asking, the call parameters include instance identification, method and parameter;
8, primary proxy program obtains JS realities according to the method invoke that above-mentioned interface calls from primary Instances Pool
Example, calls its method.
In the present embodiment, the key idea by the realization method of single-instance also based on parallel more examples of the present invention is come in fact
It is existing, unify item code style, has abandoned the literary style (in addition to the proxy program on basis) of frame, service developer is allowed to be based on me
Specification write code, be not required to it is to be understood that the literary style that React-Native frames are injected about module, also allows for us to industry
The work of some statistical analyses is made in business.
The calling overall flow of class instance method:
As shown in Figure 10, developer can obtain class from JS classes pond, and a JS object, i.e. JS examples are created by new,
And by the method call to the JS objects, realize the method call to primary example.After confirmation does not use the example, adjust
Primary example is deleted with deleteInstance interfaces.As needed, developer can be with the more a JS objects of new, each JS objects
Will exist and create corresponding primary example.
Detailed process may comprise steps of:
1, primary proxy program obtains relevant information from a custom block, i.e., one primary module;
2, the corresponding class of the primary module is added in primary class pond by primary proxy program according to acquired information;
3, primary proxy program exports the method information of added class to JS proxy programs;
4, JS proxy programs are according in such the method information creating corresponding JS classes to JS classes pond received;
5, developer obtains above-mentioned JS classes by service code from JS classes pond;
6, developer initiates to establish the requests of the corresponding JS examples of the JS classes to JS proxy programs using service code;Institute
State request in include the JS examples establishment parameter, which includes the mark and parameter of corresponding JS classes;
7, JS proxy programs send the establishment ginseng for including in the request in previous step to the primary proxy program of primary layer
Number;
8, the corresponding example of method newlnstance requests to create that primary proxy program is created according to above-mentioned interface is deposited
It stores up to primary Instances Pool.
9, developer initiates to call the request of instance method to JS proxy programs using service code;
10, JS proxy programs send the request to the primary proxy program of primary layer;The request includes being called
Example mark, method and parameter;
11, the method invoke that the interface of primary proxy program through the above steps calls is obtained from primary Instances Pool asks
Corresponding example is sought, and calls instance method.
The beam workers such as the above-mentioned collection for containing primary class, the establishment of JS classes, the establishment of JS examples, the establishment of primary example
Make, arrive the flow that specific method calls again.The realization of the present embodiment needs the primary module pond for relying on frame acquiescence, it is also desirable to
It establishes on the Instances Pool of establishment, class pond and proxy program, by accessing the class pond of JS, obtains corresponding class, be created that JS pairs
As it is possible thereby to create multiple primary examples, each example is mutually isolated, is independent of each other;To realize to multiple examples
Parallel work-flow.As shown in figure 11, it is the system architecture schematic diagram of the present embodiment.
Embodiment two
The present embodiment corresponding embodiment one provides a kind of computer readable storage medium, is stored thereon with computer program,
Described program can realize that the JS based on React-Native frames described in above-described embodiment one is called when being executed by processor
All steps that the method for primary object is included.Specific step please refers to the record of embodiment one, herein without repeating.
Embodiment three
The present embodiment corresponding embodiment one and embodiment two provide one and specifically use scene:
Assuming that demand is to realize a page, the page includes a carousel figure, a movie listings.
The data of carousel figure and the data of movie listings are obtained by different network requests, and parameter is as shown in following table one:
Table one
We can be achieved by the steps of:
1, a self-defined network module realizes grouting socket and creates interface.
2, after App starts, network module will be saved in primary class pond;Meanwhile it when creating the page, can also give birth to
At in a corresponding class to JS classes pond.
3, in JS codes, we can in the class pond of JS the corresponding class of Network Search module;Then 2 are respectively created
JS objects, i.e. JS examples;The parameter of the parameter initialization of one incoming carousel figure interface, an incoming movie listings interface is initial
Change.
The return of corresponding readjustment processing network interface can be realized with transmitted in parallel interface requests.Two interfaces are only mutually
It is vertical, do not couple.By concurrent request, it is greatly lowered the time of interface requests in this way.
In conclusion a kind of JS provided by the invention calls the method for primary object, storage medium, can realize to difference
The parallel calling of interface requests significantly shortens the interface requests time, solves the problems, such as interface interim card, improve the experience of user.
Example the above is only the implementation of the present invention is not intended to limit the scope of the invention, every to utilize this hair
Equivalents made by bright specification and accompanying drawing content are applied directly or indirectly in relevant technical field, include similarly
In the scope of patent protection of the present invention.
Claims (8)
1. a kind of method that JS calls primary object, which is characterized in that including:
A primary class pond, a primary Instances Pool and primary proxy program is respectively created in primary layer, and maps that
JS layers, corresponding JS class pond, a JS Instances Pool and JS proxy programs are obtained respectively;
The request of the example of the corresponding primary module of establishment is initiated to JS proxy programs in JS layers;
JS proxy programs send the establishment parameter for the example for including in request to primary proxy program;
Primary proxy program creates the primary reality of a corresponding primary module according to the establishment parameter in primary Instances Pool
Example, and map that in JS layers of JS Instances Pools.
2. a kind of method that JS calls primary object as described in claim 1, which is characterized in that a corresponding primary module, institute
It states and is stored with corresponding multiple primary examples in primary Instances Pool.
3. a kind of method that JS calls primary object as described in claim 1, which is characterized in that further include:
The request of the corresponding example of described one primary module of calling is initiated to JS proxy programs in JS layers;
JS proxy programs send the call parameters for the example for including in request to primary proxy program;
Primary proxy program obtains an example according to the call parameters from primary Instances Pool, and calls an example
Corresponding method.
4. a kind of method that JS calls primary object as described in claim 1, which is characterized in that it is described in JS layers into JS
Jie's module is initiated to create the request of the example of a corresponding primary module, before, including:
Primary proxy program adds corresponding primary class and primary example to primary class pond and primary respectively according to a primary module
Instances Pool, and it is respectively mapped to JS layers of JS classes pond and JS Instances Pools.
5. a kind of method that JS calls primary object as described in claim 1, which is characterized in that further include:
The request of the corresponding example of deletion is initiated to JS proxy programs in JS layers;
JS proxy programs send the instance identification for the example to be deleted for including in request to primary proxy program;
Primary proxy program is searched in primary Instances Pool according to the instance identification and deletes corresponding primary example.
6. a kind of method that JS calls primary object as described in claim 1, which is characterized in that each in the primary class pond
Each primary example between each JS classes in a primary class and JS classes pond, in the primary Instances Pool and JS Instances Pools
In each JS examples between corresponded to by unique identifier.
7. a kind of method that JS calls primary object as described in claim 1, which is characterized in that further include:
When application program launching, the class set for realizing grouting socket is obtained;
Each class in the class set is traversed, judges whether the class currently traversed realizes establishment interface, if so, will work as
Before the class that traverses preserve into primary class pond;If it is not, then create the example of the corresponding class currently traversed, and stored to
In primary Instances Pool.
8. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that described program is being handled
Device can realize all steps that the method that the JS described in the claims 1-7 any one calls primary object is included when executing
Suddenly.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810466934.2A CN108595160B (en) | 2018-05-16 | 2018-05-16 | Method and storage medium for calling native object by JS |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810466934.2A CN108595160B (en) | 2018-05-16 | 2018-05-16 | Method and storage medium for calling native object by JS |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108595160A true CN108595160A (en) | 2018-09-28 |
CN108595160B CN108595160B (en) | 2022-04-01 |
Family
ID=63631290
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810466934.2A Active CN108595160B (en) | 2018-05-16 | 2018-05-16 | Method and storage medium for calling native object by JS |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108595160B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110163926A (en) * | 2019-05-10 | 2019-08-23 | 上海莉莉丝科技股份有限公司 | Method, system, equipment and medium of the production comprising multiple scenes for repeating object |
CN113419785A (en) * | 2021-06-29 | 2021-09-21 | 宝宝巴士股份有限公司 | Method and terminal for solving cross-domain security problem when WebView loads local page |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090037829A1 (en) * | 2007-08-01 | 2009-02-05 | Microsoft Corporation | Framework to integrate web services with on-premise software |
CN104572114A (en) * | 2015-01-23 | 2015-04-29 | 盟游(北京)科技有限公司 | Binding device, application updating device and method and application |
CN105637478A (en) * | 2013-09-20 | 2016-06-01 | 甲骨文国际公司 | Computer-aided development of native mobile application code |
CN106445583A (en) * | 2016-08-31 | 2017-02-22 | 广州品唯软件有限公司 | Page display method, equipment and system |
CN106569794A (en) * | 2016-09-23 | 2017-04-19 | 北京五八信息技术有限公司 | Application developing device |
CN106569856A (en) * | 2016-11-02 | 2017-04-19 | 腾讯音乐娱乐(深圳)有限公司 | Method and device of loading application view resource file |
CN106685726A (en) * | 2017-01-11 | 2017-05-17 | 重庆邮电大学 | React-native based intelligent home monitoring system |
JP2017146769A (en) * | 2016-02-17 | 2017-08-24 | 株式会社リコー | Information processor, information process system, information processing method, and program |
CN107133322A (en) * | 2017-05-04 | 2017-09-05 | 四川长虹电器股份有限公司 | The implementation method for the common data channel that HTML is interacted with Native in Mobile solution |
CN107368487A (en) * | 2016-05-12 | 2017-11-21 | 阿里巴巴集团控股有限公司 | A kind of page assembly Dynamic Distribution method, apparatus and client |
CN107678741A (en) * | 2017-10-09 | 2018-02-09 | 武汉斗鱼网络科技有限公司 | Implementation method, device, readable storage medium storing program for executing and the equipment of List View |
-
2018
- 2018-05-16 CN CN201810466934.2A patent/CN108595160B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090037829A1 (en) * | 2007-08-01 | 2009-02-05 | Microsoft Corporation | Framework to integrate web services with on-premise software |
CN105637478A (en) * | 2013-09-20 | 2016-06-01 | 甲骨文国际公司 | Computer-aided development of native mobile application code |
CN104572114A (en) * | 2015-01-23 | 2015-04-29 | 盟游(北京)科技有限公司 | Binding device, application updating device and method and application |
JP2017146769A (en) * | 2016-02-17 | 2017-08-24 | 株式会社リコー | Information processor, information process system, information processing method, and program |
CN107368487A (en) * | 2016-05-12 | 2017-11-21 | 阿里巴巴集团控股有限公司 | A kind of page assembly Dynamic Distribution method, apparatus and client |
CN106445583A (en) * | 2016-08-31 | 2017-02-22 | 广州品唯软件有限公司 | Page display method, equipment and system |
CN106569794A (en) * | 2016-09-23 | 2017-04-19 | 北京五八信息技术有限公司 | Application developing device |
CN106569856A (en) * | 2016-11-02 | 2017-04-19 | 腾讯音乐娱乐(深圳)有限公司 | Method and device of loading application view resource file |
CN106685726A (en) * | 2017-01-11 | 2017-05-17 | 重庆邮电大学 | React-native based intelligent home monitoring system |
CN107133322A (en) * | 2017-05-04 | 2017-09-05 | 四川长虹电器股份有限公司 | The implementation method for the common data channel that HTML is interacted with Native in Mobile solution |
CN107678741A (en) * | 2017-10-09 | 2018-02-09 | 武汉斗鱼网络科技有限公司 | Implementation method, device, readable storage medium storing program for executing and the equipment of List View |
Non-Patent Citations (1)
Title |
---|
金昱东: "一种基于ReactNative的代码压缩与动态加载的实现方法", 《软件》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110163926A (en) * | 2019-05-10 | 2019-08-23 | 上海莉莉丝科技股份有限公司 | Method, system, equipment and medium of the production comprising multiple scenes for repeating object |
CN113419785A (en) * | 2021-06-29 | 2021-09-21 | 宝宝巴士股份有限公司 | Method and terminal for solving cross-domain security problem when WebView loads local page |
CN113419785B (en) * | 2021-06-29 | 2023-10-13 | 宝宝巴士股份有限公司 | Method and terminal for solving cross-domain security problem when WebView loads local page |
Also Published As
Publication number | Publication date |
---|---|
CN108595160B (en) | 2022-04-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20240139621A1 (en) | Server and Data Processing Method, Apparatus, and System | |
CN107632824B (en) | A kind of generation method of augmented reality module, generating means and generate system | |
CN103873692B (en) | Method, device and system for resource sharing | |
CN103577207B (en) | A kind of loading method and device of defined interface system median surface component | |
CN106331178B (en) | A kind of information sharing method and mobile terminal | |
CN114501501B (en) | Configuration management method, device, equipment and medium for mobile communication network target range | |
CN108595160A (en) | JS calls the method for primary object, storage medium | |
CN103888502B (en) | Projecting method, projection file providing method and projection terminal | |
CN114358921A (en) | System switching method, apparatus, device, medium, and program product | |
CN101577713B (en) | Realization method, device and testing system for virtual user identification module | |
CN106161517B (en) | The method and apparatus for realizing cloud storage access by cloud file system | |
WO2022033079A1 (en) | Pico base station configuration method and apparatus, and storage medium and electronic apparatus | |
CN109683916A (en) | A kind of method of cloud mirrored host computer of the autonomous creation comprising application software | |
CN113760733A (en) | Unit testing method and device | |
CN107665210A (en) | Data processing method and device | |
CN110248030A (en) | Test method, device, equipment and the storage medium of short message compensation mechanism | |
CN115525396A (en) | Application management method and device based on cloud protogenesis | |
CN106346481A (en) | Intelligent robot system for achieving configuration information transplanting and information transplant method | |
CN115794927B (en) | Service function expansion method and system | |
CN109766377A (en) | Cross-platform data capture method, device, computer equipment and storage medium | |
CN103402221B (en) | Method, device and system for loading software on basis of gateway data processing plate | |
CN116150540B (en) | System and method for realizing one-key switching of exhibition item content based on meta universe and cloud platform | |
CN110019533A (en) | Synchronous scenario generation method, device, equipment and computer readable storage medium | |
CN109299323B (en) | Data processing method, terminal, server and computer storage medium | |
CN112887434B (en) | Data processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |