CN112286619B - Method, electronic device, and storage medium for data-driven interface presentation - Google Patents
Method, electronic device, and storage medium for data-driven interface presentation Download PDFInfo
- Publication number
- CN112286619B CN112286619B CN202011574287.0A CN202011574287A CN112286619B CN 112286619 B CN112286619 B CN 112286619B CN 202011574287 A CN202011574287 A CN 202011574287A CN 112286619 B CN112286619 B CN 112286619B
- Authority
- CN
- China
- Prior art keywords
- configuration data
- control
- interface
- value
- items
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
Embodiments of the present disclosure relate to methods, electronic devices, and computer storage media for data driven interface presentation, and relate to the field of information processing. According to the method, a basic class object associated with a target interface to be presented is generated; obtaining, via a base class object, a plurality of items of configuration data associated with a plurality of controls in a target interface; generating, via the base class object, an adapter object based on the plurality of items of configuration data; invoking, via the adapter object, a factory class object to generate a plurality of control instances based on the plurality of control types in the plurality of items of configuration data; and calling a plurality of rendering methods in the plurality of control instances through the rendering interface based on the plurality of items of configuration data via the adapter object to render the plurality of controls. Therefore, the specific implementation of the control can be isolated, so that the frequently-changed interface is expandable and maintainable, and the code does not need to be frequently modified.
Description
Technical Field
Embodiments of the present disclosure relate generally to the field of information processing, and more particularly, to methods, electronic devices, and computer storage media for data driven interface presentation.
Background
For complex applications, such as banking applications, it is often the case that multiple interfaces, e.g., multiple form interfaces, are presented for entering various data. Conventional solutions tend to write separate process code for each interface to control the processing of that interface. When the content input in a certain control in the interface changes, all codes of all interfaces containing the control need to be rewritten. For frequently changing interfaces, a large amount of code needs to be frequently re-encoded, resulting in inefficiency.
Disclosure of Invention
A method, electronic device and computer storage medium for data driven interface presentation are provided, which can isolate the specific implementation of controls, so that frequently changing interfaces are extensible and maintainable without frequent code modification.
According to a first aspect of the present disclosure, a method for data driven interface rendering is provided. The method comprises the following steps: generating a basic class object associated with a target interface to be presented; obtaining, via a base class object, a plurality of items of configuration data associated with a plurality of controls in a target interface; generating, via the base class object, an adapter object based on the plurality of items of configuration data; invoking, via the adapter object, a factory class object to generate a plurality of control instances based on the plurality of control types in the plurality of items of configuration data; and calling a plurality of rendering methods in the plurality of control instances through the rendering interface based on the plurality of items of configuration data via the adapter object to render the plurality of controls.
According to a second aspect of the present disclosure, an electronic device is provided. The electronic device includes: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to perform the method according to the first aspect.
In a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, implements a method according to the first aspect of the present disclosure.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. In the drawings, like or similar reference characters designate like or similar elements.
FIG. 1 is a schematic diagram of an information handling environment 100 according to an embodiment of the present disclosure.
Fig. 2 is a schematic diagram of a method 200 for data driven interface presentation, according to an embodiment of the present disclosure.
Fig. 3 is a schematic diagram of an interface presentation engine 300 according to an embodiment of the present disclosure.
FIG. 4 is a schematic diagram of a method 400 for updating a value in a control associated with a computation rule based on the computation rule, according to an embodiment of the disclosure.
FIG. 5 is a block diagram of an electronic device for implementing a method for data driven interface rendering of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The term "include" and variations thereof as used herein is meant to be inclusive in an open-ended manner, i.e., "including but not limited to". Unless specifically stated otherwise, the term "or" means "and/or". The term "based on" means "based at least in part on". The terms "one example embodiment" and "one embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first," "second," and the like may refer to different or the same object. Other explicit and implicit definitions are also possible below.
As described above, the conventional scheme writes independent processing code for each interface, resulting in that a frequently changing interface requires frequent modification of a large amount of code, which is inefficient.
To address, at least in part, one or more of the above problems and other potential problems, example embodiments of the present disclosure propose a solution for data driven interface presentation. In the scheme, a basic class object associated with a target interface to be presented is generated; obtaining, via a base class object, a plurality of items of configuration data associated with a plurality of controls in a target interface; generating, via the base class object, an adapter object based on the plurality of items of configuration data; invoking, via the adapter object, a factory class object to generate a plurality of control instances based on the plurality of control types in the plurality of items of configuration data; and calling a plurality of rendering methods in the plurality of control instances through the rendering interface based on the plurality of items of configuration data via the adapter object to render the plurality of controls. In this way, the specific implementation of the control can be isolated, so that the frequently-changed interface is expandable and maintainable, and the code does not need to be frequently modified.
Hereinafter, specific examples of the present scheme will be described in more detail with reference to the accompanying drawings.
FIG. 1 shows a schematic diagram of an example of an information processing environment 100, according to an embodiment of the present disclosure. The information processing environment 100 can include a computing device 110, a plurality of items of configuration data 120 associated with a plurality of controls in a target interface to be rendered, and a plurality of rendered controls 130.
An application may be stored in the computing device 110 and may be run. While running the application, the computing device 110 may present an interface of the application.
The computing device 110 is configured to generate a base class object associated with a target interface to be presented; obtaining, via a base class object, a plurality of pieces of configuration data 120 associated with a plurality of controls 130 in a target interface; generating, via the base class object, an adapter object based on the plurality of items of configuration data; invoking, via the adapter object, a factory class object to generate a plurality of control instances based on the plurality of control types in the plurality of items of configuration data; and invoking, via the adapter object, a plurality of rendering methods in the plurality of control instances via the rendering interface based on the plurality of items of configuration data to render the plurality of controls 130.
Therefore, the control can be isolated from being specifically realized, so that the frequently-changed interface is expandable and maintainable, the code does not need to be frequently modified, and the efficiency is improved.
Fig. 2 shows a flow diagram of a method 200 for data driven interface presentation according to an embodiment of the present disclosure. For example, the method 200 may be performed by the computing device 110 as shown in FIG. 1. It should be understood that method 200 may also include additional blocks not shown and/or may omit blocks shown, as the scope of the present disclosure is not limited in this respect.
At block 202, the computing device 110 generates a base class object associated with a target interface to be presented. The target interface is associated with the application, and multiple interfaces including the target interface in the application may be implemented through the same base class object.
In some embodiments, the target interface is associated with a form.
At block 204, the computing device 110 obtains, via the base class object, a plurality of items of configuration data associated with a plurality of controls in the target interface. The computing device 110 may, for example, obtain the plurality of pieces of configuration data locally or may receive the plurality of pieces of configuration data from a server, for example, the server may store an association between an interface identification and the configuration data, the computing device 110 may send an identification of the target interface to the server, the server obtains the associated plurality of pieces of configuration data based on the identification of the target interface, the plurality of pieces of configuration data are associated with the plurality of controls in the target interface, and then the computing device 110 receives the plurality of pieces of configuration data from the server. Therefore, the control of the interface can be modified by modifying the configuration data through the server side, so that the interface is updated without rewriting codes for the interface updating.
Each configuration data item may include a plurality of configuration attributes including, for example, but not limited to, a control type, a control identification, a calculation rule (e.g., a formula), a regular expression, a keyboard type, a placeholder, and so forth.
At block 206, the computing device 110 generates an adapter object based on the plurality of items of configuration data via the base class object.
An adapter object may be included in the base class object. In particular, the base class object may generate an adapter object and pass multiple items of configuration data to the adapter object.
At block 208, the computing device 110, via the adapter object, invokes the factory class object to generate a plurality of control instances based on the plurality of control types in the plurality of items of configuration data.
The plant class object may automatically generate dynamic code, such as by APT techniques, to generate multiple control instances based on multiple control types.
At block 210, the computing device 110, via the adapter object, invokes, via the rendering interface, a plurality of rendering methods in a plurality of control instances based on the plurality of items of configuration data to render the plurality of controls.
For example, the control associated with configuration data A may be rendered by "configuration data A. control type. render ()" invoking a rendering method of the control instance associated with the control type of configuration data A, and the control associated with configuration data B may be rendered by "configuration data B. control type. render ()" invoking a rendering method of the control instance associated with the control type of configuration data A. The above-mentioned invocation may be implemented in particular by an Annotation Processing Technique (APT).
FIG. 3 shows a schematic diagram of an interface presentation engine 300 according to an embodiment of the present disclosure. As shown in FIG. 3, interface A310 and interface B320 are each implemented by a base class object 330. For a first interface A310 to be rendered, the base class object 330 obtains a plurality of items of configuration data (including a plurality of control types) associated with a plurality of controls (e.g., controls A and B) in the interface A310 to be rendered, then generates the adapter object 340, and passes the plurality of items of configuration data into the adapter object 340. The adapter object 340 calls the plant class object 350 to generate a plurality of control instances (e.g., control instances a and B) based on the plurality of control types, the plurality of control instances implementing a rendering method of the rendering interface 360 (also referred to as a rendering interface), and the adapter object 340 may call the plurality of rendering methods in the plurality of control instances (e.g., control instances a and B) via the rendering interface 360 to render the plurality of controls (e.g., controls a and B) in the interface a 310. The specific implementation can be hidden through the interfaces, and the adapter only recognizes the interfaces, so that the ISP interface isolation principle is realized, and the maintenance is convenient. The control instance implementation adopts the principle of DIP dependence inversion, and the control does not need to know an adapter object to reduce coupling.
Similarly, adapter object 340 may also initialize, wad verify, and normalize values in multiple controls by invoking initialization methods, wad verify methods, and normalization methods in multiple control instances through initialization interface 370, wad verify interface 380, and normalization interface 390.
Therefore, the control can be isolated from being specifically realized, so that the frequently-changed interface is expandable and maintainable, the code does not need to be frequently modified, and the efficiency is improved.
In some embodiments, at least one of the plurality of items of configuration data may include a calculation rule. The calculation rule determines a value in a control associated with the configuration data comprising the calculation rule based on at least two values in at least two controls associated with at least two items of configuration data in the plurality of configuration data.
Different configuration data associated with different controls may include different calculation rules. For example, configuration data a associated with a first control may include a first calculation rule that may specify: the value in the first control associated with configuration data a = the value in the second control associated with configuration data B + the value in the third control associated with configuration data C, configuration data B associated with the second control may include a second calculation rule, which may specify: the value in the second control associated with configuration data B = the value in the third control associated with the item of configuration data C and the value in the fourth control associated with configuration data D.
FIG. 4 illustrates a flow diagram of a method 400 for updating a value in a control associated with a computation rule based on the computation rule, in accordance with an embodiment of the present disclosure. For example, the method 400 may be performed by the computing device 110 as shown in FIG. 1. It should be understood that method 400 may also include additional blocks not shown and/or may omit blocks shown, as the scope of the disclosure is not limited in this respect.
At block 402, the computing device 110 may generate, via the adapter object, a plurality of key-value pairs with the identity of the configuration data on which the computation rule is based as a key and the configuration data including the computation rule as a value.
Taking the above two calculation rules as examples, for the first calculation rule, key-value pairs (configuration data identifier B, configuration data a) and (configuration data identifier C, configuration data a) are generated, and for the second calculation rule, key-value pairs (configuration data identifier C, configuration data B) and (configuration data identifier D, configuration data B) are generated.
At block 404, the computing device 110 calls, through the collection interface, a collection method in the adapter object via a control instance associated with a control of the plurality of controls that completed value entry to pass to the adapter object an identification of configuration data associated with the control that completed value entry and a value in the control that completed value entry as a current identification and current value.
For example, the value input in the third control is complete, and the identification C of the configuration data C associated with the third control and the value in the third control may be passed to the adapter object as the current identification and current value by calling a collection method in the adapter object through the collection interface via the control instance of the third control.
At block 406, the computing device 110 determines whether at least one item of configuration data matching the current identification is found from the plurality of key-value pairs with the current identification as a key.
If, at block 406, the computing device 110 determines whether at least one configuration data matching the current identification is found from the plurality of key-value pairs with the current identification as a key, then, at block 408, via the adapter object, a value in a control associated with the currently traversed configuration data is determined based on the current value and the computing rule included in the currently traversed configuration data in the at least one configuration data.
At block 410, the computing device 110 determines whether at least one item of configuration data matching the identification is found from the plurality of key-value pairs with the identification of the currently traversed configuration data as a key.
If, at block 410, computing device 110 determines that configuration data matching the identification is found from the plurality of key-value pairs with the identification of the currently traversed configuration data as a key, then, at block 412, a value in the control associated with the configuration data matching the identification is determined based on the computing rule included in the configuration data matching the identification and the value in the control associated with the currently traversed configuration data.
If, at block 410, the computing device 110 determines that at least one configuration data matching the identification is not found from the plurality of key-value pairs with the identification of the currently traversed configuration data as a key, then, at block 414, it is determined whether the traversal of the at least one configuration data ends.
If it is determined at block 414 that the traversal of the at least one configuration data is not complete, then the next configuration data in the at least one configuration data is traversed back to block 408.
For example, at least one item of configuration data a and B corresponding to the current identifier C is found from a plurality of key value pairs (configuration data identifier B, configuration data a), (configuration data identifier C, configuration data B), and (configuration data identifier D, configuration data B) with the current identifier C as a key. The found configuration data a and B are then traversed.
For configuration data a, based on the first calculation rule and the current value included in configuration data a (in this case, the value in control C), the value in the control associated with configuration data a is determined, that is, the value in the control associated with configuration data a = the value in the control associated with configuration data B (in this case, the value in the control associated with configuration data B is not updated) + the value in the control associated with configuration data C. This branch process ends because the value in the control associated with configuration data a is updated, and at least one piece of configuration data corresponding to identity a is not found from the plurality of key-value pairs keyed by the current identity a.
Then, for configuration data B, based on the second calculation rule and the current value included in configuration data B (in this case, the value in control C), the value in the control associated with configuration data B is determined, that is, the value in the control associated with configuration data B = the value in the control associated with configuration data C ×. the value in the control associated with configuration data D. Due to the updating of the value in the control associated with configuration data B, at least one item of configuration data a corresponding to identity B is found from the above-mentioned plurality of key value pairs keyed by current identity B, so that the value in the control associated with configuration data a, i.e. the value in the control associated with configuration data a = the value in the control associated with configuration data B (when the value in the control associated with configuration data B has been updated) + the value in the control associated with configuration data C is determined, again based on the first calculation rule and the current value included in configuration data a (when the value in the control associated with configuration data B is updated). This branch process ends because the value in the control associated with configuration data a is updated, and at least one piece of configuration data corresponding to identity a is not found from the plurality of key-value pairs keyed by the current identity a.
Subsequently, this step ends, as the traversal of the found configuration data a and B ends, generating two values in the two controls associated respectively with the configuration data a and B
If it is determined at block 414 that the at least one configuration data traversal is complete, at block 416, the computing device 110 invokes, via the adapter object, at least one rendering method in the at least one control instance based on the at least one configuration data via the rendering interface to render at least one value in the at least one control associated with the at least one configuration data.
For example, values in the control associated with configuration data A and values in the control associated with the configuration data B item are rendered by the rendering interface calling a rendering method in the control instance associated with configuration data A and B.
Therefore, value linkage between the controls can be realized on the adapter layer, mutual communication between the controls is not needed, decoupling between the controls is realized, and therefore expandability and maintainability of the interface are realized.
Alternatively or additionally, in some embodiments, the computing device 110 may also at least one of initialize, check, and normalize values in the plurality of controls via the base class object. The check includes, for example, but not limited to, a mandatory check, a canonical check, and the like. Normalization may, for example, unify values into a predetermined format. Therefore, initialization, verification, standardization and other processing are uniformly carried out through the basic class objects, so that repeated coding is not needed for a plurality of interfaces, and maintenance is facilitated.
Alternatively or additionally, in some embodiments, the computing device 110, via the adapter object, invokes, through the predetermined interface, a predetermined method in a control instance of the plurality of control instances that implements the predetermined interface to operate on a value in a control associated with the control instance. The predetermined interface includes at least one of an initialization interface, a verification interface, and a standardized interface. Thus, initialization, checksum normalization specific to each control may be embodied by each control instance.
Fig. 5 illustrates a schematic block diagram of an example device 500 that may be used to implement embodiments of the present disclosure. For example, computing device 110 as shown in fig. 1 may be implemented by device 500. As shown, device 500 includes a Central Processing Unit (CPU) 501 that may perform various appropriate actions and processes according to computer program instructions stored in a Read Only Memory (ROM) 502 or computer program instructions loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
A number of components in the device 500 are connected to the I/O interface 505, including: an input unit 506 such as a keyboard, a mouse, a microphone, and the like; an output unit 507 such as various types of displays, speakers, and the like; a storage unit 508, such as a magnetic disk, optical disk, or the like; and a communication unit 509 such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The various processes and processes described above, such as the methods 200, 400, may be performed by the central processing unit 501. For example, in some embodiments, the methods 200, 400 may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 500 via the ROM 502 and/or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the central processing unit 501, one or more of the actions of the methods 200, 400 described above may be performed.
The present disclosure relates to methods, apparatuses, systems, electronic devices, computer-readable storage media and/or computer program products. The computer program product may include computer-readable program instructions for performing various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.
Claims (7)
1. A method for data driven interface presentation, comprising:
generating a basic class object associated with a target interface to be presented;
obtaining, via the base class object, a plurality of items of configuration data associated with a plurality of controls in the target interface;
generating, via the base class object, an adapter object based on the plurality of items of configuration data;
invoking, via the adapter object, a factory class object to generate a plurality of control instances based on a plurality of control types in the plurality of items of configuration data; and
invoking, via the adapter object, a plurality of rendering methods in the plurality of control instances through a rendering interface based on the plurality of items of configuration data to render the plurality of controls;
wherein at least one of the plurality of configuration data comprises a calculation rule that determines a value in a control associated with configuration data comprising the calculation rule based on at least two values in at least two controls associated with at least two of the plurality of configuration data, and the method further comprises:
generating, via the adapter object, a plurality of key-value pairs with an identification of configuration data on which the computation rule is based as a key and configuration data comprising the computation rule as a value;
invoking, via a collection interface, a collection method in the adapter object via a control instance associated with a control of the plurality of controls that completes value entry to pass to the adapter object an identification of configuration data associated with the control that completes value entry and a value in the control that completes value entry as a current identification and a current value;
traversing, via the adapter object, each of the at least one item of configuration data if it is determined that at least one item of configuration data matching the current identification is found from the plurality of key value pairs with the current identification as a key, the steps of:
determining a value in a control associated with the currently traversed configuration data based on the current value and a calculation rule included in the currently traversed configuration data; and
if it is determined that configuration data matching the identity of the currently traversed configuration data is found from the plurality of key value pairs with the identity of the currently traversed configuration data as a key, determining a value in a control associated with the configuration data matching the identity of the currently traversed configuration data based on a calculation rule included in the configuration data matching the identity of the currently traversed configuration data and a value in the control associated with the currently traversed configuration data;
invoking, via the adapter object, at least one rendering method in at least one control instance based on the at least one configuration data through the rendering interface to render at least one value in at least one control associated with the at least one configuration data.
2. The method of claim 1, further comprising:
at least one of initializing, checking, and normalizing values in the plurality of controls via the base class object.
3. The method of claim 1, further comprising:
and calling a predetermined method in a control instance realizing the predetermined interface in the plurality of control instances through a predetermined interface to operate the value in the control associated with the control instance through the adapter object.
4. The method of claim 3, wherein the predetermined interface comprises at least one of an initialization interface, a verification interface, and a standardized interface.
5. The method of claim 1, wherein obtaining the plurality of items of configuration data comprises:
sending the identification of the target interface to a server; and
receiving, from the server, a plurality of items of configuration data associated with the identification of the target interface.
6. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
7. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011574287.0A CN112286619B (en) | 2020-12-28 | 2020-12-28 | Method, electronic device, and storage medium for data-driven interface presentation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011574287.0A CN112286619B (en) | 2020-12-28 | 2020-12-28 | Method, electronic device, and storage medium for data-driven interface presentation |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112286619A CN112286619A (en) | 2021-01-29 |
CN112286619B true CN112286619B (en) | 2021-05-07 |
Family
ID=74426440
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011574287.0A Active CN112286619B (en) | 2020-12-28 | 2020-12-28 | Method, electronic device, and storage medium for data-driven interface presentation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112286619B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106095508A (en) * | 2016-06-17 | 2016-11-09 | 杭州财人汇网络股份有限公司 | A kind of strategy loads and the method and device injected |
CN109976738A (en) * | 2019-03-29 | 2019-07-05 | 山东云缦智能科技有限公司 | It is a kind of to realize that dynamic adjusts the charging method of charging SDK partner based on design pattern |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7191450B2 (en) * | 2003-02-06 | 2007-03-13 | International Business Machines Corporation | Data-driven application integration adapters |
CN110764791B (en) * | 2019-10-25 | 2023-10-27 | 网易(杭州)网络有限公司 | Channel adaptation method and device for applet and electronic equipment |
-
2020
- 2020-12-28 CN CN202011574287.0A patent/CN112286619B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106095508A (en) * | 2016-06-17 | 2016-11-09 | 杭州财人汇网络股份有限公司 | A kind of strategy loads and the method and device injected |
CN109976738A (en) * | 2019-03-29 | 2019-07-05 | 山东云缦智能科技有限公司 | It is a kind of to realize that dynamic adjusts the charging method of charging SDK partner based on design pattern |
Non-Patent Citations (1)
Title |
---|
IOS适配器设计模式;佚名;《http://www.cocoachina.com/articles/17740》;20161013;第1-5页 * |
Also Published As
Publication number | Publication date |
---|---|
CN112286619A (en) | 2021-01-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9430228B2 (en) | Verification of backward compatibility of software components | |
US9262237B2 (en) | Automating software availability management based on API versioning | |
CN110389786B (en) | Kernel management method, electronic device and computer-readable storage medium | |
CN111460815B (en) | Rule processing method, apparatus, medium, and electronic device | |
CN110688096B (en) | Method and device for constructing application program containing plug-in, medium and electronic equipment | |
CN114066475A (en) | Information security protection method based on cloud payment and server | |
CN111654555A (en) | Method, electronic device and storage medium for message distribution | |
CN112243024B (en) | Service control method, device, server and storage medium | |
CN112286619B (en) | Method, electronic device, and storage medium for data-driven interface presentation | |
CN116302218B (en) | Function information adding method, device, equipment and storage medium | |
CN111966430B (en) | Method, electronic device and storage medium for multi-container compatible local invocation | |
CN107665124B (en) | Modular JavaScript file processing method, device and server | |
CN111142972B (en) | Method, apparatus, system, and medium for extending functions of application program | |
US11281681B2 (en) | Message parser runtime choices | |
CN113724115A (en) | Data processing method and server based on online education | |
CN114115855A (en) | Code multiplexing method and device, computer readable storage medium and electronic equipment | |
CN116263690A (en) | Method and device for virtual machine to read data from external system and relevant written data | |
CN111078230A (en) | Code generation method and device | |
Nguyen et al. | Data storage adapter in big data platform | |
CN110780864A (en) | Control method and device for class method replacement, storage medium and electronic equipment | |
CN113656050A (en) | Method and device for generating version number | |
US20240152363A1 (en) | Management device, communication system, management method, and non-transitory computer-readable medium | |
US20230110520A1 (en) | Ui service package generation and registration method and apparatus, and ui service loading method and apparatus | |
CN110795076B (en) | Data processing method and device for realizing basic logic algorithm | |
CN114415612B (en) | Intelligent production monitoring method and server based on artificial intelligence |
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 |