CN101477461A - Dynamic generation apparatus and method for application program interface - Google Patents

Dynamic generation apparatus and method for application program interface Download PDF

Info

Publication number
CN101477461A
CN101477461A CNA2009100056650A CN200910005665A CN101477461A CN 101477461 A CN101477461 A CN 101477461A CN A2009100056650 A CNA2009100056650 A CN A2009100056650A CN 200910005665 A CN200910005665 A CN 200910005665A CN 101477461 A CN101477461 A CN 101477461A
Authority
CN
China
Prior art keywords
interface
application program
description
interface element
definition
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.)
Pending
Application number
CNA2009100056650A
Other languages
Chinese (zh)
Inventor
黄磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CNA2009100056650A priority Critical patent/CN101477461A/en
Publication of CN101477461A publication Critical patent/CN101477461A/en
Priority to PCT/CN2010/070499 priority patent/WO2010091623A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Abstract

The invention provides a device for dynamically generating an application program interface. The device comprises an external interface, an interface description interpreter, an element manager, a layout manager and an element wrapper. The external interface is used for receiving an interface description file and outputting to the interface description interpreter; the interface description interpreter is used for analyzing the interface description file according to the description definition of preset interface elements and obtaining the attribute information and layout information of the interface elements; the element manager is used for calling interface element codes wrapped in the element wrapper according to the attribute information received from the interface description interpreter, and creating and arranging the interface elements; the layout manager is used for arranging the interface elements created by the element manager according to the layout information received from the interface description interpreter and generating the application program interface; the element wrapper is used for wrapping the interface element codes. The device has the advantages of dynamically generating the application program interface, greatly reducing the coupling degree between logical codes and interface codes, and enabling the application program interface to be more flexible. At the same time, the invention further provides a method for dynamically generating the application program interface.

Description

Application Program Interface dynamic generation apparatus and method
Technical field
The present invention relates to the interface tech field, particularly Application Program Interface dynamic generation apparatus and method.
Background technology
At present, most application programs have all adopted graphic user interface as Application Program Interface, along with enriching of function of application, the design of program interface also becomes increasingly complex, for making things convenient for the design and development of Application Program Interface, the general graphical storehouse that Application Program Interface generates has appearred much being used for, for example GTK (GIMP Toolkit) is exactly one that wherein is most widely used, GTK provides abundant interface function to construct the Application Program Interface element, application developer can be in the logical code of application program, create and the required interface element of layout by GTK primitive, thereby construct lively graphical Application Program Interface.In addition, use interface Core Generator, can generate the interface code more easily, thereby save the development time at interface based on GTK.
Fig. 1 is for generating the process flow diagram of Application Program Interface by existing interface Core Generator, as shown in Figure 1, this flow process comprises the steps:
Step 101, the interface Core Generator generates interface description.
The interface Core Generator is according to selection and the setting of user to interface element, corresponding relation by default interface element and interface description generates interface description, interface description is an intermediate file, the various interfaces relevant information such as attribute, layout that comprises interface element is used to describe the various features at interface.The interface description that generates can be the interface description file that adopts the XML form, and the user can pass through to revise undesirable part in the interface description, thereby obtains required interface description.
Step 102, interface Core Generator generate the C language codes file of interface portion according to interface description.
The interface Core Generator is according to the C language codes corresponding relation of interface description and concrete GTK interface element, generation meets the C language codes file of the concrete interface portion of interface description, simultaneously, the user can revise undesirable part in the C language codes file, for example add call back function etc., finally obtain required interface C language codes.
Existing interface Core Generator can only generate the file that comprises the interface C language codes, and the C language codes of interface portion also needs to compile with the logical code of application program, generates final application program execute file.Simultaneously, in the logical code of application program, need call the also interface description of parsing XML format, and call structure generation interface, GTK storehouse by the C language codes of interface portion.
With respect to directly using GTK primitive API to generate the method for interface portion C language codes, adopt the interface Core Generator can so that the generation of interface code greatly simplify, most of code is generated according to interface element code masterplate automatically by the interface Core Generator, last need be carried out minor modifications to the standard code that generates, just can generate satisfactory interface code.
Though what the interface Core Generator can the simplifying interface code writes, simultaneously by interface description as the bridge between logical code and the interface code, accomplished to a certain extent that also the interface code separates with the part of logical code, reduced interactive degree between interface code and the logical code, it is the degree of coupling, but, the C language codes of the interface portion that the interface Core Generator generates is connected because need compiling together with the logical code of application program, the code that still will comprise interface portion in the code of in fact final application program, certain degree of coupling is still arranged, in this case, when there is adjustment at the interface, even tiny adjustment such as interface element attribute, also need to revise application program, repeat a plurality of steps that above-mentioned interface generates, last be connected with the logical code compiling of application program again, the dirigibility of INTERFACE DESIGN and extensibility can be subjected to bigger restriction, for the later maintenance of Application Program Interface with more new capital is very inconvenient.
In addition, existing interface Core Generator provides numerous and diverse interface, in the logical code of application program, need to use a lot of interfaces and interface element mutual, increased the complexity of application program virtually, strengthened the difficulty and the complicacy of interface development to a certain extent.
Summary of the invention
The embodiment of the invention provides a kind of Application Program Interface dynamic generation apparatus, and the logical code of application program and the interface code degree of coupling are significantly reduced, and makes the Application Program Interface design more flexible.
The embodiment of the invention provides a kind of graphic user interface dynamic creation method, and the logical code of application program and the interface code degree of coupling are significantly reduced, and makes the Application Program Interface design more flexible.
For achieving the above object, technical scheme of the present invention specifically is achieved in that
A kind of Application Program Interface dynamic generation apparatus, this device comprises:
External interface links to each other with the interface description interpreter, and the reception interface description document also exports the interface description interpreter to;
The interface description interpreter links to each other with described external interface, from described external interface reception interface description document, according to the description definition resolution interface description document of default interface element, obtains the attribute information and the layout information of interface element;
The element manager links to each other respectively with the element wrapper with the interface description interpreter, calls the interface element that encapsulates the element wrapper according to the attribute information that receives from the interface description interpreter and generates masterplate, creates and be provided with interface element;
Layout manager links to each other with the interface description interpreter, and according to the layout information that receives from the interface description interpreter, the interface element that described element manager is created carries out layout, generates Application Program Interface;
The element wrapper links to each other with described element manager, is used to preserve the interface element code of encapsulation.
A kind of Application Program Interface dynamic creation method, this method comprises:
The reception interface description document;
Description definition according to default interface element is resolved the interface description file, obtains the attribute information and the layout information of interface element;
Call the interface element code establishing of encapsulation in advance and interface element is set according to described attribute information, interface element is carried out layout, generate Application Program Interface according to described layout information.
As seen from the above technical solutions, this Application Program Interface dynamic generation apparatus of the present invention and method, generate Application Program Interface by predefined interface description, the logical code part of application program need not participate in concrete interface and generate, only need provide the interface description file, by the interface element code of Application Program Interface dynamic generation apparatus by encapsulating in advance, create and laying-out interface element, dynamically generate needed interface portion, the logical code part of application program need not comprise concrete interface generating code, make the logical code part and the degree of coupling of interface code section reduce significantly, make the Application Program Interface design more flexible, reduce later maintenance cost and interface development difficulty.
Description of drawings
Fig. 1 is for generating the process flow diagram of Application Program Interface by existing interface Core Generator;
Fig. 2 is the applied environment synoptic diagram of the Application Program Interface dynamic generation apparatus of the embodiment of the invention;
Fig. 3 is the Application Program Interface dynamic generation apparatus structural representation of first embodiment of the invention;
Fig. 4 is the Application Program Interface dynamic generation apparatus structural representation of second embodiment of the invention;
Fig. 5 is the interface description interpreter structural representation of first embodiment of the invention;
Fig. 6 is the interface description interpreter structural representation of second embodiment of the invention;
Fig. 7 is the element manager structural representation of the embodiment of the invention;
Fig. 8 is the Application Program Interface dynamic creation method process flow diagram of the embodiment of the invention;
Fig. 9 is the dynamic interface generation method particular flow sheet of first embodiment of the invention;
Figure 10 is the dynamic interface generation method particular flow sheet of second embodiment of the invention.
Embodiment
For making purpose of the present invention, technical scheme and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in more detail.
The present invention mainly is the dynamic generation that has realized Application Program Interface by the dynamic interface generating apparatus, make in the application program and need not comprise the interface code, only need provide interface description, this installs the generating code of package interface element in advance, by the resolution interface description and according to interface description dynamic creation and laying-out interface element, generate Application Program Interface; Only need call interface description can obtain required interface in the application program, do not need to write the C language codes of interface portion, the interface code is thoroughly separated with logical code, greatly reduced the degree of coupling between logical code and the interface code, make the Application Program Interface exploitation more flexible, extensibility is strong, and the workload of later maintenance and modification greatly reduces, only need to revise the interface description file and can realize the modification at interface, need not consider problem with the logical code link edition.
Fig. 2 is the applied environment synoptic diagram of the Application Program Interface dynamic generation apparatus of the embodiment of the invention.As shown in Figure 2, in operating system, comprise application program 201 and shape library 202, wherein, the Application Program Interface dynamic generation apparatus 203 of the embodiment of the invention is based in shape library 202, encapsulate interface element code in advance based on shape library, and the pre-defined interface description corresponding with interface element, dynamically generate the interface according to the interface description file, application program 201 can be communicated by letter with interface dynamic generation apparatus 204 by interface 203, for example send the interface description file to Application Program Interface dynamic generation apparatus 204, Application Program Interface dynamic generation apparatus 204 obtains the interface element relevant information by the resolution interface description document, for example comprise any interface element in the interface, the attribute information of interface element and layout information etc., by encapsulation in advance based on the interface element code establishing interface element of shape library and be provided with and layout, obtain the Application Program Interface that needs.When using Application Program Interface dynamic generation apparatus 204 of the present invention, 201 needs of application program send to Application Program Interface dynamic generation apparatus 204 of the present invention with interface description, and the process that specifically generates the interface is finished by Application Program Interface dynamic generation apparatus 204 of the present invention, so need not to contain concrete interface code in the application program.
Interface of the present invention dynamic generation apparatus goes for operating systems such as form windows or linux, and the interface description file can adopt XML form or other Languages form to realize; Shape library can be GTK or GTK+ figures material database.Be example with interface description file and the GTK shape library that adopts the XML form below, the embodiment of Application Program Interface dynamic generation apparatus of the present invention is illustrated.
Fig. 3 is the Application Program Interface dynamic generation apparatus structural representation of first embodiment of the invention; As shown in Figure 3, this device comprises: external interface 301, interface description interpreter 302, element manager 303, layout manager 304, element wrapper 305;
External interface 301 links to each other with interface description interpreter 302, and the reception interface description document also exports interface description interpreter 302 to; Be the interactive interface that is used to provide with the logical code part of application program, for example provide the interface dynamic generation apparatus is carried out initialization, obtains physical interface function such as certain element from interface description document creation interface, according to element term from the interface.The interface function that provides should be lacked as far as possible, thereby reduces interface development person's learning cost, also can significantly reduce in the application program, is used for the size of code with the interface alternation part.For example: initialization interface is used for receiving instruction application programs interface dynamic generation apparatus and carries out initialization; The interface description interface is used for the reception interface description document; Element obtains interface, is used for receiving the interface element that the Application Program Interface that generates is exported in instruction.Physical interface can also have much according to the function of required realization, has just given unnecessary details no longer one by one here.
Interface description interpreter 302, link to each other with external interface 301, receive the interface description file of XML forms and, obtain the attribute information and the layout information of interface element from external interface 301 according to the interface description file of the description definition parsing XML format of default interface element; Attribute information comprises type, for example button, radio box, text box of interface element etc., and the specific object information under the type, the interface element attribute is relevant with concrete shape library, adopt the GTK shape library in the present embodiment, so the element property of definition is best and the GTK shape library can be consistent as far as possible, understands with convenient.Certainly, specifically how the XML of interface element is described and define and to determine according to concrete needs.
Element manager 303 links to each other respectively with element wrapper 305 with interface description interpreter 302, calls the interface element code masterplate of encapsulation the element wrapper 305 according to the attribute information that receives from interface description interpreter 302, creates and be provided with interface element.The element manager is used for interface element is carried out Dynamic Maintenance, comprise the establishment element, element property is set, destroy element etc., these concrete maintenance functions all have definition in GTK primitive, here just given unnecessary details no longer one by one, and the logic behavior of element, such as click event processing of button etc., then can give application program monitors voluntarily and handles, for example externally provide the interface function of realization in the interface 301 to the monitoring and the processing of element logic behavior, to keep the dirigibility of application development, can certainly realize that the specific implementation method has not just been given unnecessary details one by one by the element manager here.
Layout manager 304 links to each other with interface description interpreter 302 and element manager 303, and according to the layout information that receives from the interface description interpreter, the interface element that described element manager 303 is created carries out layout, obtains the Application Program Interface that needs; The function of arranging that can make full use of the GTK shape library when arranging provides is arranged.The responsibility that GTK adopts container mechanism rationally to separate control, almost all interface elements all are containers, can hold other any interface element; With the coordinate position of each subwindow of layout mechanism dynamic calculation, the variation of self-adaptation screen size.Therefore layout manager can adopt the layout type of GTK to come interface element is carried out layout fully, certainly, also can determine layout type according to concrete needs.
Element wrapper 305 links to each other with described element manager 303, is used to preserve the interface element code of encapsulation; The interface element code of these encapsulation is based on that the grammer of GTK shape library generates, and is equivalent to the code masterplate of interface element, when generating interface element, can apply mechanically these default masterplates and generate concrete interface element.
Fig. 4 is the Application Program Interface dynamic generation apparatus structural representation of second embodiment of the invention; As shown in Figure 4, this device is on the basis of first embodiment, except that comprising external interface 401, interface description interpreter 402, element manager 403, layout manager 404, element wrapper 405, also further comprised function expanding module 406, link to each other with interface description interpreter 402, be used to write down the attribute and the layout information of all interface elements that interface description interpreter 402 parses.By writing down these information, application program can be carried out unified modification to attributes such as the pattern of interface element or colors, realizes functions such as the theme skin change at interface or colour changing, and other function can be added as required, has not just given unnecessary details one by one here.By function expanding module 406, Application Program Interface dynamic generation apparatus of the present invention can provide abundant more interface function.
Fig. 5 is the interface description interpreter structural representation of first embodiment of the invention, and as shown in Figure 5, this interface description interpreter comprises:
Element definition module 501, the description definition that is used to preserve interface element.
Attribute information parsing module 502 links to each other with element definition module 501, and the description definition that is used for preserving according to element definition module 501 parses the attribute information of interface element from the interface description file.
Layout information parsing module 503 links to each other with element definition module 501, and the description definition that is used for preserving according to element definition module 501 parses the layout information of interface element from the interface description file.
Fig. 6 is the interface description interpreter structural representation of second embodiment of the invention, and as shown in Figure 6, described interface description interpreter comprises: element definition module 601, and attribute information parsing module 602, layout information parsing module 603 further comprises:
Masterplate category information parsing module 604 links to each other with described element definition module 603, and the description definition that is used for preserving according to element definition module 603 parses the masterplate category information of interface element from the interface description file;
Attribute information parsing module 602 further links to each other with masterplate category information parsing module 604 on the basis of first embodiment shown in Figure 5, parses the attribute information of interface element according to described masterplate category information;
Layout information parsing module 603 further links to each other with masterplate category information parsing module 604 on the basis of first embodiment shown in Figure 5, parses the layout information of interface element according to described masterplate category information.
Fig. 7 is the element manager structural representation of the embodiment of the invention, and as shown in Figure 7, described element manager comprises:
Element creation module 701 is used for calling the interface element generating code that the element wrapper is preserved according to the attribute information of interface element, creates interface element;
Element is provided with module 702, links to each other with described element creation module 701, is used for being provided with according to the interface element that the attribute information of interface element is created described element creation module 701.
In above-mentioned two embodiment, definition to interface element in the interface description can set up on their own as required, concrete definition can realize by configuration file, can revise description definition rule by revising configuration file to interface element, thereby more neatly the description definition of interface element is made amendment, some concrete description definition rule examples are provided below, can be for reference.
The definition of XML form interface description is exemplified below:
<window?name="Login?Wnd"position="0,0"size="510,430"title="SignOn">
This section is described the newly-built window of expression, and wherein window name represents the window name, and position represents the position, size represents size, title represents window title, and these statements and form are pre-defined, and according to these definition interface description information is resolved.
It is as follows that this describes the pairing false code that realizes based on GTK primitive:
m_gtkWindow=gtk_window_new();
gtk_window_set_title(GTK_WINDOW(m_gtk?Window),"Sign?On");
gtk_widget_set_size_request(m_gtk?Window,510,430);
gtk_window_set_position(GTK_WINDOW(m_gtkWindow),0,0);
And for example:
<button?align="container"size="90,48"label="Enter"name="btnEnter"/>
This section is described the newly-built button of expression, and button align=" container " represents that this button is a container.
It is as follows that this describes the pairing false code that realizes based on GTK primitive:
m_gtkButton=gtk_button_new();
gtk_button_set_label(GTK_BUTTON(m_gtkButton),"Enter");
gtk_widget_set_size_request(m_gtkButton,90,48);
gtk_container_add(GTK_CONTAINER(m_gtkWindow),m_gtkButton)
The definition basically identical of above-mentioned two sections descriptions and GTK primitive, be beneficial to very much understanding, in addition, except the function primitive of the definition of element and attribute and GTK keeps consistency, interface element arrange and layout on, also adopt the container adaptive characteristic of GTK itself, as the gtk_container_add of the align=" container " correspondence in the top code as far as possible; So just can guarantee the maximization of Resize efficient, also guarantee the user when the Reszie window, each element can be level and smooth in the window automatic adjustment position and size.
In actual applications, because the element itself that the GTK shape library provides is powerful, attribute is numerous, and interface method is also many, and describing these attributes of an element in the interface description of XML form one by one can be more loaded down with trivial details; And in general, in the required interface of application program, have many elements to possess same or similar characteristics, their attribute possesses certain general character, the description content of many repetitions can occur.As follows:
<Box?name="myMainBox1">
<prop?align="packstart"expand="false"fill="false"pad="0"/>
<prop?boxType="vbox"homogeneous="false"spacing="0"/>
</Box>
......
<Box?name="myMainBox2">
<prop?align="packstart"expand="false"fill="false"pad="2"/>
<prop?boxType="vbox"homogeneous="false"spacing="0"/>
</Box>
......
In the top interface description, two interface elements are about the same, have only " pad " attribute difference.At above problem,, can adopt the design of element property template class based on the definition of XML interface element configuration.According to the characteristics of product performance, the description content that defines some elements commonly used or that possess big versatility or local interface by XML under the practical application scene, is directly used these element template class descriptive elements as the element template class in advance.Indivedual places possess personalized or and the attribute of template elements with certain otherness, redescribe voluntarily in can describing by Application Program Interface, for example:
<Classname="vbox">
<prop?align="packstart"expand="false"fill="false"pad="0"/>
<prop?boxType="vbox"homogeneous=false"spacing="0"/>
</Class>
......
<Box?name="myMainBox1"class="vbox"pad="2">
<Box?name="myMainBox2"class="vbox">
......
In the above-mentioned masterplate,<Class name=" vbox "〉and</Class between part be exactly the definition the masterplate class, below when describing interface element, just can directly use the masterplate class to describe interface element, for with the masterplate class in incomplete same part, get final product after only different part pad=" 2 " need being added on the masterplate class.By the masterplate generic attribute of definition interfaces element, can significantly reduce in the interface description file description complexity and difficulty for the same interface element, improve the formation efficiency of interface description.
To specifically introduce the Application Program Interface dynamic creation method of the embodiment of the invention below.
Fig. 8 is the Application Program Interface dynamic creation method process flow diagram of the embodiment of the invention, and as shown in Figure 8, this method comprises the steps:
Step 801, the reception interface description document;
Step 802 is resolved the interface description file according to the description definition of default interface element.
Can obtain the attribute information and the layout information of interface element behind the interface description document analysis, specifically, can obtain the interface element of describing in the interface description file successively during parsing, judge that described interface element is whether legal and can support, if, then obtain the description content of this interface element, the description content of this interface element is resolved according to the description definition of default interface element; Otherwise from the interface description file, obtain the description content of next interface element, in interface description all interface element all layout finish, promptly constructed and interface description file corresponding application program interface.
In addition, as if judging that described interface element is legal and can supporting, can judge further then whether described interface element contains the masterplate category information, if, then obtain the masterplate category information of this interface element, and, obtain the description content of this interface element according to the corresponding relation between the description content of default masterplate category information and interface element.
Judge that interface element is whether legal and can support, can judge according to default interface description grammer, description content grammaticalness regulation and requirement, it is legal to think, grammaticalness and description content also have predefined, can be judged as and can support, concrete determination methods belongs to existing mature technology, has just repeated no more here.
Step 803 is called the interface element code establishing of encapsulation in advance and interface element is set according to attribute information, according to described layout information interface element is carried out layout, generates Application Program Interface.
After step 803, the attribute and the layout information of all interface elements in the Application Program Interface of the described generation of all right further record.For application program interface element is carried out unified modification and realize expanded functions such as interface subject, skin, color replacement.
Fig. 9 is the dynamic interface generation method particular flow sheet of first embodiment of the invention, and as shown in Figure 9, this flow process comprises the steps:
Step 901 loads XML interface description file.
Receive XML interface description file by external interface, and resolve, parse the attribute information and the layout information of interface element according to predefined description.If also defined the masterplate generic attribute of interface element in advance, then also can parse the masterplate category information of interface element.
Step 902 is obtained next interface element, if having, then execution in step 903, otherwise process ends.
Obtain the interface element that parses one by one, until obtaining the interface element that all parses.
Step 903 is judged that interface element is whether legal and can be supported, if then execution in step 904, otherwise returns step 902.
This step need judge whether interface element meets definition in advance or can support the processing of this element, if interface element meets definition in advance and can support, then continue next step operation, otherwise think that this interface element is illegal or can not support, can not handle or return miscue this interface element;
Step 904 is written into element property.
The attribute information and the layout information of interface element are loaded in internal memory or the buffer memory.
Step 905 is created the GTK element.
According to the interface element attribute information, call the interface element code of encapsulation in advance, create corresponding GTK element based on the primitive of GTK shape library.
Step 906 is provided with the GTK element property and carries out layout, returns step 902.
The GTK element of creating is provided with according to attribute information, carries out layout according to layout information.
After all interface elements are all finished attribute setting and layout, after just can't getting access to interface element again in the step 902, the interface structure finishes, and the developer can obtain the GTK element object according to element term, be absorbed in the logic development of program, needn't be concerned about numerous and diverse interface adjustment and layout.
Figure 10 is the dynamic interface generation method particular flow sheet of second embodiment of the invention, and as shown in figure 10, this flow process comprises the steps:
Step 1001~1002 are identical with step 901~902.
Step 1003 is judged that interface element is whether legal and can be supported, if then execution in step 1004, otherwise returns step 1002.
Step 1004 judges whether interface element comprises the masterplate generic attribute, if execution in step 1005 then, otherwise execution in step 1006.
Step 1005 is written into the masterplate generic attribute.
Be written into the masterplate class public attribute of interface element.
Step 1006 is written into element property.
Be written into the privately owned attribute that interface element itself is different from masterplate class public attribute, just be different from the distinctive information of the masterplate category information of interface element.
Step 1007~1008, identical with step 905~906, repeat no more here.
Among second embodiment, increased support to the masterplate generic attribute.Can reduce the complexity that similar element property is described.
By the above embodiments as seen, Application Program Interface dynamic generation apparatus of the present invention and method, generate Application Program Interface by predefined interface description, the logical code part of application program need not participate in concrete interface and generate, only need provide the interface description file, by the interface element code of Application Program Interface dynamic generation apparatus by encapsulating in advance, create and laying-out interface element, dynamically generate needed interface portion, the logical code part of application program need not comprise concrete interface generating code, make the logical code part and the degree of coupling of interface code section reduce significantly, make the Application Program Interface design more flexible, reduce later maintenance cost and interface development difficulty.In addition, by the masterplate generic attribute of definition interfaces element, can further reduce the complexity and the development difficulty of interface description.Record by to all interface element attributes in each interface that generates and the interface can further provide Expansion Interface functions such as for example theme skin replacing, colour changing, makes interface development convenient.
Institute is understood that; the above is a better embodiment of the present invention only, and is not intended to limit the scope of the invention, and is within the spirit and principles in the present invention all; any modification of being made, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1, a kind of Application Program Interface dynamic generation apparatus is characterized in that, this device comprises:
External interface links to each other with the interface description interpreter, and the reception interface description document also exports the interface description interpreter to;
The interface description interpreter links to each other with described external interface, from described external interface reception interface description document, according to the description definition resolution interface description document of default interface element, obtains the attribute information and the layout information of interface element;
The element manager links to each other respectively with the element wrapper with the interface description interpreter, calls the interface element code that encapsulates the element wrapper according to the attribute information that receives from the interface description interpreter, creates and be provided with interface element;
Layout manager links to each other with interface description interpreter and element manager, and according to the layout information that receives from the interface description interpreter, the interface element that described element manager is created carries out layout, generates Application Program Interface;
The element wrapper links to each other with described element manager, is used for the package interface element code.
2, Application Program Interface dynamic generation apparatus as claimed in claim 1 is characterized in that, described interface description interpreter comprises:
The element definition module, the description definition that is used to preserve interface element;
The attribute information parsing module links to each other with described element definition module, and the described description definition that is used for preserving according to described element definition module parses the attribute information of interface element from the interface description file;
The layout information parsing module links to each other with described element definition module, and the described description definition that is used for preserving according to described element definition module parses the layout information of interface element from the interface description file.
3, Application Program Interface dynamic generation apparatus as claimed in claim 1 or 2 is characterized in that, described element manager comprises:
The element creation module is used for calling the interface element code that the element wrapper is preserved according to the attribute information of interface element, creates interface element;
Element is provided with module, links to each other with described element creation module, is used for being provided with according to the interface element that the attribute information of interface element is created described element creation module.
4, Application Program Interface dynamic generation apparatus as claimed in claim 3 is characterized in that, described element definition module, the description definition that is further used for preserving the element masterplate;
Described interface description interpreter further comprises:
Masterplate category information parsing module links to each other with described element definition module, and the description definition that is used for the element masterplate preserved according to described element definition module parses the masterplate category information of interface element from the interface description file;
Described interface element package module is further used for encapsulating the element masterplate;
Described element creation module is further used for calling element masterplate and the interface element code that encapsulates in the element wrapper according to the masterplate category information of described interface element, creates interface element.
5, Application Program Interface dynamic generation apparatus as claimed in claim 1 or 2 is characterized in that, described external interface comprises:
Initialization interface is used for receiving instruction application programs interface dynamic generation apparatus and carries out initialization;
The interface description interface is used for the reception interface description document;
Element obtains interface, is used for receiving the interface element that the Application Program Interface that generates is exported in instruction.
6, Application Program Interface dynamic generation apparatus as claimed in claim 1 or 2 is characterized in that, this device further comprises:
Function expanding module links to each other with described layout manager, is used for writing down the attribute and the layout information of all interface elements of Application Program Interface of described generation.
7, a kind of Application Program Interface dynamic creation method is characterized in that, this method comprises:
The reception interface description document;
Description definition according to default interface element is resolved the interface description file, obtains the attribute information and the layout information of interface element;
Call the interface element code establishing of encapsulation in advance and interface element is set according to described attribute information, interface element is carried out layout, generate Application Program Interface according to described layout information.
8, Application Program Interface dynamic creation method as claimed in claim 7, it is characterized in that, after the described attribute information and layout information that obtains interface element, call the interface element code establishing of encapsulation in advance and be provided with before the interface element, further comprise according to described attribute information:
Obtain the interface element that parses successively, judge that the described interface element that parses is whether legal and can support, if then obtain the attribute information and the layout information of this interface element; Otherwise obtain the interface element that the next one parses.
9, Application Program Interface dynamic creation method as claimed in claim 8, it is characterized in that, as if judging that described interface element is legal and can supporting, then further judge whether the described interface element that parses contains the masterplate category information, if, then obtain the masterplate category information of this interface element earlier, obtain the distinctive information that this interface element is different from the masterplate category information again.
10, as claim 7,8 or 9 described Application Program Interface dynamic creation methods, it is characterized in that, after the described generation Application Program Interface, further write down the attribute and the layout information of all interface elements in the Application Program Interface of described generation.
CNA2009100056650A 2009-02-10 2009-02-10 Dynamic generation apparatus and method for application program interface Pending CN101477461A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CNA2009100056650A CN101477461A (en) 2009-02-10 2009-02-10 Dynamic generation apparatus and method for application program interface
PCT/CN2010/070499 WO2010091623A1 (en) 2009-02-10 2010-02-03 Apparatus and method for dynamically generating application program interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2009100056650A CN101477461A (en) 2009-02-10 2009-02-10 Dynamic generation apparatus and method for application program interface

Publications (1)

Publication Number Publication Date
CN101477461A true CN101477461A (en) 2009-07-08

Family

ID=40838183

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2009100056650A Pending CN101477461A (en) 2009-02-10 2009-02-10 Dynamic generation apparatus and method for application program interface

Country Status (2)

Country Link
CN (1) CN101477461A (en)
WO (1) WO2010091623A1 (en)

Cited By (39)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010091623A1 (en) * 2009-02-10 2010-08-19 腾讯科技(深圳)有限公司 Apparatus and method for dynamically generating application program interface
CN102118649A (en) * 2009-12-31 2011-07-06 康佳集团股份有限公司 Method and device for switching network television interface
CN102541566A (en) * 2012-01-04 2012-07-04 北京七星华创电子股份有限公司 Method for generating interface frameworks of semiconductor software
CN102591627A (en) * 2011-01-13 2012-07-18 腾讯科技(深圳)有限公司 Flash application program development system and application request processing method
CN102722367A (en) * 2012-05-21 2012-10-10 深圳市茁壮网络股份有限公司 Method for data processing, processor and terminal
CN102890632A (en) * 2012-09-18 2013-01-23 深圳市融创天下科技股份有限公司 Screen adaptation method, system and terminal device
CN102945161A (en) * 2012-10-24 2013-02-27 中国航空工业集团公司西安飞机设计研究所 Method for displaying and controlling formatting page on basis of embedded system
CN103019683A (en) * 2012-11-20 2013-04-03 北京思特奇信息技术股份有限公司 Method for dynamically configuring page view
CN103530338A (en) * 2013-10-01 2014-01-22 北界创想(北京)软件有限公司 Frame for carrying out page rendering on calculation equipment and page generation method
CN103617037A (en) * 2013-11-27 2014-03-05 张洁 Developing method for web development system and web development system
CN103823676A (en) * 2014-02-14 2014-05-28 珠海市君天电子科技有限公司 Display control method, display control device and client side
CN103902256A (en) * 2012-12-24 2014-07-02 航天信息股份有限公司 Interface generating system and method
CN104090749A (en) * 2014-05-30 2014-10-08 爱培科科技开发(深圳)有限公司 Processing method and system for updating and changing interface theme of WinCE product
CN104239044A (en) * 2014-09-05 2014-12-24 北京航天自动控制研究所 Dynamic generation method for graphical user interface
CN104267968A (en) * 2014-10-16 2015-01-07 福建星网视易信息系统有限公司 Interface switching method and device
CN104331284A (en) * 2014-10-29 2015-02-04 北京思特奇信息技术股份有限公司 Method and system for generating and displaying dynamic page
CN104360866A (en) * 2014-12-01 2015-02-18 深圳七彩畅想网络技术有限公司 Code generating method and code generator
CN104484171A (en) * 2014-12-11 2015-04-01 深圳市路通网络技术有限公司 System, method and associated equipment for designing terminal interface
CN104657039A (en) * 2015-02-12 2015-05-27 广州华多网络科技有限公司 Interface subject display method and system as well as service equipment
CN104731590A (en) * 2015-03-13 2015-06-24 广东欧珀移动通信有限公司 Method and device for realizing user interface controls
CN104915201A (en) * 2015-05-29 2015-09-16 北京奇艺世纪科技有限公司 Interface generating method and device
CN105094769A (en) * 2014-05-06 2015-11-25 北大方正集团有限公司 Processing method and apparatus of user interface
CN105094768A (en) * 2014-05-06 2015-11-25 北大方正集团有限公司 Application interface generation method and application interface generation device
CN105718289A (en) * 2016-01-21 2016-06-29 腾讯科技(深圳)有限公司 Component relationship establishing method and equipment
CN105786455A (en) * 2014-12-17 2016-07-20 深圳市腾讯计算机系统有限公司 Method, device and terminal for data processing
CN105867931A (en) * 2016-04-07 2016-08-17 北京橙鑫数据科技有限公司 Method and device of changing information display interface
WO2016150388A1 (en) * 2015-03-25 2016-09-29 中兴通讯股份有限公司 Interface processing method, apparatus, and system
CN102591627B (en) * 2011-01-13 2016-12-14 腾讯科技(深圳)有限公司 A kind of Flash application development system and application request processing method
CN106293658A (en) * 2015-05-20 2017-01-04 腾讯科技(深圳)有限公司 A kind of interface assembly generates method and equipment thereof
CN106445494A (en) * 2009-10-14 2017-02-22 韦尔迈格服务有限公司 Automated enterprise software development
CN106708490A (en) * 2015-11-17 2017-05-24 百度在线网络技术(北京)有限公司 Interface setting method and device for application program
CN106970926A (en) * 2016-01-14 2017-07-21 卓望数码技术(深圳)有限公司 A kind of Mobile solution interface dynamic generation method and system
CN107506227A (en) * 2017-09-04 2017-12-22 郑州云海信息技术有限公司 The method and apparatus for managing compiled code
CN107562428A (en) * 2017-09-08 2018-01-09 上海博科资讯股份有限公司 Rule-based adaptable software quick interface arrangement method and system
WO2018137144A1 (en) * 2017-01-24 2018-08-02 北京广利核系统工程有限公司 Graphical user interface (gui) system
CN109117228A (en) * 2018-08-01 2019-01-01 浙江口碑网络技术有限公司 The generation method and device of graphical interfaces
CN111026366A (en) * 2019-11-12 2020-04-17 贝壳技术有限公司 User interface implementation method and device, storage medium and electronic equipment
CN111694345A (en) * 2020-06-24 2020-09-22 深圳市元征科技股份有限公司 Vehicle diagnosis menu generation method, device, equipment and medium
CN113741834A (en) * 2020-05-29 2021-12-03 Oppo(重庆)智能科技有限公司 Interface display method and device, electronic equipment and computer readable storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108984174B (en) * 2018-07-03 2022-04-12 百度在线网络技术(北京)有限公司 Cross-platform application creation method, device, server and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10351351B4 (en) * 2003-11-04 2007-03-22 Siemens Ag Method and system for the dynamic generation of user interfaces
CN1304945C (en) * 2004-06-02 2007-03-14 中兴通讯股份有限公司 Automatic generatnig method for configuration interface of telecommunicating apparatus
CN101266543A (en) * 2008-01-14 2008-09-17 中兴通讯股份有限公司 Graphical interfaces processing unit and method
CN101477461A (en) * 2009-02-10 2009-07-08 腾讯科技(深圳)有限公司 Dynamic generation apparatus and method for application program interface

Cited By (59)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010091623A1 (en) * 2009-02-10 2010-08-19 腾讯科技(深圳)有限公司 Apparatus and method for dynamically generating application program interface
CN106445494A (en) * 2009-10-14 2017-02-22 韦尔迈格服务有限公司 Automated enterprise software development
CN102118649A (en) * 2009-12-31 2011-07-06 康佳集团股份有限公司 Method and device for switching network television interface
CN102591627A (en) * 2011-01-13 2012-07-18 腾讯科技(深圳)有限公司 Flash application program development system and application request processing method
CN102591627B (en) * 2011-01-13 2016-12-14 腾讯科技(深圳)有限公司 A kind of Flash application development system and application request processing method
CN102541566A (en) * 2012-01-04 2012-07-04 北京七星华创电子股份有限公司 Method for generating interface frameworks of semiconductor software
CN102722367A (en) * 2012-05-21 2012-10-10 深圳市茁壮网络股份有限公司 Method for data processing, processor and terminal
CN102722367B (en) * 2012-05-21 2015-11-25 深圳市茁壮网络股份有限公司 A kind of method of data processing, processor and terminal
CN102890632A (en) * 2012-09-18 2013-01-23 深圳市融创天下科技股份有限公司 Screen adaptation method, system and terminal device
CN102945161A (en) * 2012-10-24 2013-02-27 中国航空工业集团公司西安飞机设计研究所 Method for displaying and controlling formatting page on basis of embedded system
CN103019683A (en) * 2012-11-20 2013-04-03 北京思特奇信息技术股份有限公司 Method for dynamically configuring page view
CN103902256B (en) * 2012-12-24 2017-05-10 航天信息股份有限公司 Interface generating system and method
CN103902256A (en) * 2012-12-24 2014-07-02 航天信息股份有限公司 Interface generating system and method
CN103530338A (en) * 2013-10-01 2014-01-22 北界创想(北京)软件有限公司 Frame for carrying out page rendering on calculation equipment and page generation method
US9904522B2 (en) 2013-11-27 2018-02-27 Jie Zhang Web development system
CN103617037A (en) * 2013-11-27 2014-03-05 张洁 Developing method for web development system and web development system
CN103617037B (en) * 2013-11-27 2017-12-08 邵寻 Development approach and web development system for web development system
CN103823676A (en) * 2014-02-14 2014-05-28 珠海市君天电子科技有限公司 Display control method, display control device and client side
CN103823676B (en) * 2014-02-14 2018-01-30 珠海市君天电子科技有限公司 display control method, device and client
CN105094769A (en) * 2014-05-06 2015-11-25 北大方正集团有限公司 Processing method and apparatus of user interface
CN105094768A (en) * 2014-05-06 2015-11-25 北大方正集团有限公司 Application interface generation method and application interface generation device
CN105094769B (en) * 2014-05-06 2018-07-13 北大方正集团有限公司 The treating method and apparatus of user interface
CN104090749A (en) * 2014-05-30 2014-10-08 爱培科科技开发(深圳)有限公司 Processing method and system for updating and changing interface theme of WinCE product
CN104090749B (en) * 2014-05-30 2015-09-16 爱培科科技开发(深圳)有限公司 A kind of WinCE Product Interface theme upgrades transform process method and system
CN104239044A (en) * 2014-09-05 2014-12-24 北京航天自动控制研究所 Dynamic generation method for graphical user interface
CN104239044B (en) * 2014-09-05 2017-07-28 北京航天自动控制研究所 A kind of graphic user interface dynamic creation method
CN104267968A (en) * 2014-10-16 2015-01-07 福建星网视易信息系统有限公司 Interface switching method and device
CN104267968B (en) * 2014-10-16 2017-12-26 福建星网视易信息系统有限公司 The method and apparatus of changing interface
CN104331284A (en) * 2014-10-29 2015-02-04 北京思特奇信息技术股份有限公司 Method and system for generating and displaying dynamic page
CN104360866A (en) * 2014-12-01 2015-02-18 深圳七彩畅想网络技术有限公司 Code generating method and code generator
CN104484171A (en) * 2014-12-11 2015-04-01 深圳市路通网络技术有限公司 System, method and associated equipment for designing terminal interface
CN104484171B (en) * 2014-12-11 2018-05-29 深圳市路通网络技术有限公司 Terminal interface design system, method and relevant device
CN105786455A (en) * 2014-12-17 2016-07-20 深圳市腾讯计算机系统有限公司 Method, device and terminal for data processing
CN104657039B (en) * 2015-02-12 2018-01-09 广州华多网络科技有限公司 A kind of interface subject display methods, system and service equipment
CN104657039A (en) * 2015-02-12 2015-05-27 广州华多网络科技有限公司 Interface subject display method and system as well as service equipment
CN104731590B (en) * 2015-03-13 2018-04-27 广东欧珀移动通信有限公司 A kind of user interface controls implementation method and device
CN104731590A (en) * 2015-03-13 2015-06-24 广东欧珀移动通信有限公司 Method and device for realizing user interface controls
WO2016150388A1 (en) * 2015-03-25 2016-09-29 中兴通讯股份有限公司 Interface processing method, apparatus, and system
CN106162353A (en) * 2015-03-25 2016-11-23 中兴通讯股份有限公司 Interface processing method, Apparatus and system
CN106293658B (en) * 2015-05-20 2020-11-27 腾讯科技(深圳)有限公司 Interface component generation method and equipment
CN106293658A (en) * 2015-05-20 2017-01-04 腾讯科技(深圳)有限公司 A kind of interface assembly generates method and equipment thereof
CN104915201A (en) * 2015-05-29 2015-09-16 北京奇艺世纪科技有限公司 Interface generating method and device
CN106708490A (en) * 2015-11-17 2017-05-24 百度在线网络技术(北京)有限公司 Interface setting method and device for application program
CN106970926A (en) * 2016-01-14 2017-07-21 卓望数码技术(深圳)有限公司 A kind of Mobile solution interface dynamic generation method and system
CN105718289B (en) * 2016-01-21 2020-12-29 腾讯科技(深圳)有限公司 Component relation establishing method and equipment
CN105718289A (en) * 2016-01-21 2016-06-29 腾讯科技(深圳)有限公司 Component relationship establishing method and equipment
CN105867931B (en) * 2016-04-07 2019-05-07 北京橙鑫数据科技有限公司 The variation and device at information displaying interface
CN105867931A (en) * 2016-04-07 2016-08-17 北京橙鑫数据科技有限公司 Method and device of changing information display interface
WO2017173914A1 (en) * 2016-04-07 2017-10-12 北京橙鑫数据科技有限公司 Method and device for changing information display interface
WO2018137144A1 (en) * 2017-01-24 2018-08-02 北京广利核系统工程有限公司 Graphical user interface (gui) system
EP3525089A4 (en) * 2017-01-24 2020-06-10 China Techenergy Co., Ltd Graphical user interface (gui) system
CN107506227A (en) * 2017-09-04 2017-12-22 郑州云海信息技术有限公司 The method and apparatus for managing compiled code
CN107562428A (en) * 2017-09-08 2018-01-09 上海博科资讯股份有限公司 Rule-based adaptable software quick interface arrangement method and system
CN109117228A (en) * 2018-08-01 2019-01-01 浙江口碑网络技术有限公司 The generation method and device of graphical interfaces
CN111026366A (en) * 2019-11-12 2020-04-17 贝壳技术有限公司 User interface implementation method and device, storage medium and electronic equipment
CN111026366B (en) * 2019-11-12 2023-09-22 贝壳技术有限公司 User interface implementation method and device, storage medium and electronic equipment
CN113741834A (en) * 2020-05-29 2021-12-03 Oppo(重庆)智能科技有限公司 Interface display method and device, electronic equipment and computer readable storage medium
CN111694345A (en) * 2020-06-24 2020-09-22 深圳市元征科技股份有限公司 Vehicle diagnosis menu generation method, device, equipment and medium
CN111694345B (en) * 2020-06-24 2021-11-12 深圳市元征科技股份有限公司 Vehicle diagnosis menu generation method, device, equipment and medium

Also Published As

Publication number Publication date
WO2010091623A1 (en) 2010-08-19

Similar Documents

Publication Publication Date Title
CN101477461A (en) Dynamic generation apparatus and method for application program interface
CN111045655B (en) Page rendering method and device, rendering server and storage medium
US8407610B2 (en) Executable and declarative specification for graphical user interfaces
US8418132B2 (en) Application description language
JP4812337B2 (en) Method and apparatus for generating a form using a form type
US20060248169A1 (en) System for designing and performing web application
EP3037958B1 (en) Declarative user interface representation conversion via hierarchical templates
JP2004005568A (en) Updating of high-speed gui style of legacy application
CN104636139A (en) Visualized cross-platform mobile application development and generation system
CN102495735A (en) Web end UI (user interface) component application frame system
CN110096278B (en) Extensible embedded man-machine interface tool implementation method
CN105117234B (en) A kind of web control combination method
CN101477463A (en) Software platform and software development platform used for digital television set-top box
CN108874464A (en) Middleware automatically scanning assembly method, device and storage medium
CN108153533B (en) Method and device for making installation program, and method and device for installing program
CN104063231B (en) Test resource rapid access method based on HIT-TENA
CN107341027A (en) The generation method and generating means of user interface
CN117289930B (en) Construction method and system suitable for data large screen custom theme style
CN102999371A (en) Lua script-based human-computer interface development method and system
CN104063219B (en) The form development approach and system of a kind of WEB systems
CN111142861B (en) Method and device for integrating structured comprehensive control system
CN114281335A (en) View generation method and related equipment
CN114489619A (en) Interface view display method, terminal equipment and computer readable storage medium
CN114089999A (en) Front-end page generation method and system
Grolaux et al. Qtk: An integrated model-based approach to designing executable user interfaces

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20090708