CN111708583A - Method and equipment for plug-in application of MVC (model view controller) network - Google Patents
Method and equipment for plug-in application of MVC (model view controller) network Download PDFInfo
- Publication number
- CN111708583A CN111708583A CN202010445402.8A CN202010445402A CN111708583A CN 111708583 A CN111708583 A CN 111708583A CN 202010445402 A CN202010445402 A CN 202010445402A CN 111708583 A CN111708583 A CN 111708583A
- Authority
- CN
- China
- Prior art keywords
- plug
- data
- mvc
- defining
- mvc network
- 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.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 230000006870 function Effects 0.000 description 28
- 238000004590 computer program Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000010276 construction Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013499 data model Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
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/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
-
- 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/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
- G06F9/4451—User profiles; Roaming
-
- 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/445—Program loading or initiating
- G06F9/44594—Unloading
-
- 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)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a method and equipment for plug-in application of an MVC network, wherein the method comprises the following steps: defining a structured document according to a pre-adding function, and setting reference relations of components of each part in a plug-in the document; defining a service assembly file in an MVC network architecture, and setting information of data required by a plug-in the service assembly file; the MVC network scans and loads the plug-ins and calls the required data set in the service assembly file to display on the interface of the MVC network. By using the scheme of the invention, the third-party function loading and unloading can be realized without restarting the original MVC network service, and the advantage of hot plug is realized.
Description
Technical Field
The field relates to the field of computers, and more particularly to a method and apparatus for plug-in application for an MVC network.
Background
The MVC network application has higher requirements on stability, and meanwhile, in order to cooperate with a third party, the third party is allowed to expand on the basis of the application architecture of the third party, so that function expansion is realized. The contradiction exists between the stability and the high function expansion, and how to coordinate the contradiction between the stability and the high function expansion is an important problem for the MVC network application to expand the function of the MVC network application.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a method and an apparatus for a plug-in application of an MVC network, where the method of the present invention can achieve the advantages of loading and unloading of a third party function and achieving "hot plug" without restarting an original MVC network service, and the plug-in is implemented based on an MVC network application architecture, thereby ensuring the stability thereof, and meanwhile, the plug-in is implemented by a self-owned data provider, thereby achieving a personalized third party function.
In view of the above object, an aspect of the embodiments of the present invention provides a method for a plug-in application of an MVC network, comprising the steps of:
defining a structured document according to a pre-adding function, and setting reference relations of components of each part in a plug-in the document;
defining a service assembly file in an MVC network architecture, and setting information of data required by a plug-in the service assembly file;
the MVC network scans and loads the plug-ins and calls the required data set in the service assembly file to display on the interface of the MVC network.
According to one embodiment of the invention, the structured document comprises an xml file.
According to one embodiment of the invention, defining a structured document according to the pre-adding function, and setting the reference relation of each part component in the plug-in the document comprises the following steps:
writing an xml file according to a pre-adding function to show the description information of each part of the components in the plug-in;
reference relationships of parts of components in the plug-in are defined.
According to one embodiment of the invention, the defining of the service assembly file in the MVC network architecture and the setting of the information of the data required by the plug-in the service assembly file comprise:
defining a data source of data required by the plug-in;
setting specific information of a data source;
and acquiring specific data through the data source, and integrating the acquired data source based on the specific information.
According to one embodiment of the invention, the data sources include third party provided data sources and data sources of the MVC network.
In another aspect of the embodiments of the present invention, there is also provided an apparatus for a plug-in application of an MVC network, the apparatus including:
the definition module is configured to define a structured document according to the pre-adding function and set the reference relation of each part of components in the plug-in the document;
the setting module is configured to define a service assembly file in the MVC network architecture and set information of data required by the plug-in the service assembly file;
and the calling module is configured to scan and load the plug-in for the MVC network and call the required data set in the service assembly file to display on the interface of the MVC network.
According to one embodiment of the invention, the structured document comprises an xml file.
According to one embodiment of the invention, the definition module is further configured to:
writing an xml file according to a pre-adding function to show the description information of each part of the components in the plug-in;
reference relationships of parts of components in the plug-in are defined.
According to an embodiment of the invention, the setting module is further configured to:
defining a data source of data required by the plug-in;
setting specific information of a data source;
and acquiring specific data through the data source, and integrating the acquired data source based on the specific information.
According to one embodiment of the invention, the data sources include third party provided data sources and data sources of the MVC network.
The invention has the following beneficial technical effects: the method for the plug-in application of the MVC network, provided by the embodiment of the invention, defines a structured document according to a pre-adding function, and sets the reference relation of each part of components in the plug-in the document; defining a service assembly file in an MVC network architecture, and setting information of data required by a plug-in the service assembly file; the technical scheme that the MVC network scans and loads the plug-in and calls the required data set in the service assembly file to display on the interface of the MVC network has the advantages that the third-party function loading and unloading can be realized without restarting the original MVC network service, and the hot plug is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a method of plug-in application for an MVC network according to one embodiment of the present invention;
fig. 2 is a schematic diagram of a device of a plug-in application of an MVC network according to one embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
In view of the above object, a first aspect of embodiments of the present invention proposes an embodiment of a method for plug-in application of an MVC network. Fig. 1 shows a schematic flow diagram of the method.
As shown in fig. 1, the method may include the steps of:
s1, defining a structured document according to the pre-adding function, and setting the reference relation of each part component in the plug-in the document;
s2 defining a service assembly file in the MVC network architecture, and setting information of data required by the plug-in the service assembly file;
and S3, the MVC network scans and loads the plug-in, and calls the required data set in the service assembly file to display on the interface of the MVC network.
Aiming at the requirements of function optimization and high expansibility based on the MVC network application, the plug-in implementation method is based on the basic architecture of the original MVC network application, so that the compatibility of the plug-in and the original MVC network application can be ensured, the seamless combination of third-party function expansion and the MVC network application is realized through the plug-in description file, and the compatibility and the stability of a third-party function component and the MVC network application are ensured. The plug-in can provide own data, original MVC network application data and a combination of the own data and the original MVC network application data through the specific implementation of a back-end data provider, and expands the original MVC network application function. The method is realized in a plug-in mode, and the loading and unloading of the third-party functions can be realized without restarting the original MVC network service, so that the hot plug is realized.
Through the technical scheme of the invention, the method has the advantages that the third-party function loading and unloading can be realized without restarting the original MVC network service, and the hot plug is realized.
The method comprises two parts of contents, namely front-end Web Archive (page display) realization and back-end DataProvider (data supply) realization, wherein the front-end Web Archive realization indicates how a front-end page of a third-party functional component is embedded in a Web page of MVC network application, a Web page organization relation and a page data source through a plug-in description file; the back-end Data Provider is realized mainly by communication between the plug-in and the Data source, and the Data acquisition function is realized. The Data source can be the Data of the MVC network application, or the Data source of the third party application, and meanwhile, the Data Provider can process the acquired Data to realize the display after the two are combined.
In a preferred embodiment of the invention, the structured document comprises an xml file.
In a preferred embodiment of the present invention, defining a structured document according to the pre-add function, and setting reference relationships of components of each part in the plug-in the document comprises:
writing an xml file according to a pre-adding function to show the description information of each part of the components in the plug-in;
reference relationships of parts of components in the plug-in are defined.
The components of the plugin and the relation between the components of the plugin and the page components of the MVC network application are described by a plugin descriptive file, the plugin descriptive file can be realized in a structural document form, such as an xml file, and is used for structurally displaying the description information of the components of the plugin, and the key part of the plugin descriptive file is as shown in the following table 1:
table 1 plug-in descriptive file key section
All parts of the plug-in descriptive file are combined to form the page style, the data source and the corresponding operation of all the components of the plug-in.
The specific implementation form and description of the xml are as follows:
parts of the plug-in may be clearly interpreted in the xml file, generally as a page description and implementation. When the MVC application is exposed on a web page, the page specified in the xml file will be exposed, with its data source populated by the data provider. When the MVC network application loads the plug-in, the corresponding page is loaded in the Web page through the plug-in description file, and specific data is displayed through a data model in the plug-in description file.
In a preferred embodiment of the present invention, the defining a service assembly file in the MVC network architecture, and the setting information of data required by the plug-in the service assembly file includes:
defining a data source of data required by the plug-in;
setting specific information of a data source;
and acquiring specific data through the data source, and integrating the acquired data source based on the specific information.
In a preferred embodiment of the present invention, the data sources include third party provided data sources and data sources of the MVC network.
And realizing data provision according to the MVC network application architecture, and defining descriptive files of service assembly, such as Spring bundle-context and bundle-context-osgi files. The service assembly file refers to a configuration file of the MVC network application at the startup time of the server, and since the plug-in needs to provide own data source, specific information of the provided data source needs to be explained at the startup time.
The data provider service is defined in the descriptive of service assembly, and meanwhile, the construction parameters of the data provider are given. The data provider service should be a specific class name, and the specific implementation of the class should be defined consistently. Specific information of the data source, namely the data type and the name, needs to be described in the configuration file, how to describe the data source is embodied on the code, and the data type and the construction parameters are embodied on the code.
The implementation from a back end to a third party data source is defined in the data provider service, which mainly comprises the following steps: realizing the message routing from the data provider service to a third-party data source; the data provider service registers a data object type with the MVC network architecture, wherein the data object type can be a data type originated from a third party data, can also be a data type applied by the MVC network, and can also be a combination of the data object type and the data type; and the data provider service acquires data, performs data processing, and finally displays the data on a front-end Web Archive through the data processing.
The data processing result mainly differs according to the requirements of page display effect, and roughly comprises the following steps: acquiring original data; calculating and combining data; and (4) pushing data.
Through the technical scheme of the invention, the method has the advantages that the third-party function loading and unloading can be realized without restarting the original MVC network service, and the hot plug is realized.
It should be noted that, as will be understood by those skilled in the art, all or part of the processes in the methods of the above embodiments may be implemented by instructing relevant hardware through a computer program, and the above programs may be stored in a computer-readable storage medium, and when executed, the programs may include the processes of the embodiments of the methods as described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
Furthermore, the method disclosed according to an embodiment of the present invention may also be implemented as a computer program executed by a CPU, and the computer program may be stored in a computer-readable storage medium. The computer program, when executed by the CPU, performs the above-described functions defined in the method disclosed in the embodiments of the present invention.
In view of the above object, a second aspect of the embodiments of the present invention proposes an apparatus for a plug-in application of an MVC network, as shown in fig. 2, the apparatus 200 includes:
the definition module is configured to define a structured document according to the pre-adding function and set the reference relation of each part of components in the plug-in the document;
the setting module is configured to define a service assembly file in the MVC network architecture and set information of data required by the plug-in the service assembly file;
and the calling module is configured to scan and load the plug-in for the MVC network and call the required data set in the service assembly file to display on the interface of the MVC network.
In a preferred embodiment of the invention, the structured document comprises an xml file.
In a preferred embodiment of the invention, the definition module is further configured to:
writing an xml file according to a pre-adding function to show the description information of each part of the components in the plug-in;
reference relationships of parts of components in the plug-in are defined.
In a preferred embodiment of the present invention, the setting module is further configured to:
defining a data source of data required by the plug-in;
setting specific information of a data source;
and acquiring specific data through the data source, and integrating the acquired data source based on the specific information.
In a preferred embodiment of the present invention, the data sources include third party provided data sources and data sources of the MVC network.
It should be particularly noted that the embodiment of the system described above employs the embodiment of the method described above to specifically describe the working process of each module, and those skilled in the art can easily think that the modules are applied to other embodiments of the method described above.
Further, the above-described method steps and system elements or modules may also be implemented using a controller and a computer-readable storage medium for storing a computer program for causing the controller to implement the functions of the above-described steps or elements or modules.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
The embodiments described above, particularly any "preferred" embodiments, are possible examples of implementations and are presented merely to clearly understand the principles of the invention. Many variations and modifications may be made to the above-described embodiments without departing from the spirit and principles of the technology described herein. All such modifications are intended to be included within the scope of this disclosure and protected by the following claims.
Claims (10)
1. A method for plug-in application of MVC network, comprising the steps of:
defining a structured document according to a pre-adding function, and setting reference relations of components of all parts in the plug-in the document;
defining a service assembly file in an MVC network architecture, and setting information of data required by the plug-in the service assembly file;
and the MVC network scans and loads the plug-in, and calls the required data set in the service assembly file to display on an interface of the MVC network.
2. The method of claim 1, wherein the structured document comprises an xml file.
3. The method of claim 2, wherein defining a structured document according to a pre-add function and setting reference relationships of parts components in the plug-in the document comprises:
writing the xml file according to the pre-adding function to show the description information of each part of the components in the plug-in;
defining reference relationships for the respective parts of the components in the plug-in.
4. The method of claim 1, wherein defining a service assembly file in the MVC network architecture and setting information of data required by the plug-in the service assembly file comprises:
defining a data source of data required by the plug-in;
setting specific information of a data source;
and acquiring specific data through the data source, and integrating the acquired data source based on the specific information.
5. The method of claim 4, wherein the data sources comprise third party provided data sources and data sources of the MVC network.
6. An apparatus of a plug-in application for an MVC network, the apparatus comprising:
the definition module is configured to define a structured document according to a pre-adding function and set reference relations of all parts of components in the plug-in the document;
a setting module configured to define a service assembly file in an MVC network architecture and set information of data required by the plug-in the service assembly file;
the calling module is configured to scan and load the plug-in for the MVC network and call the required data set in the service assembly file to display on an interface of the MVC network.
7. The apparatus of claim 6, wherein the structured document comprises an xml file.
8. The device of claim 7, wherein the definition module is further configured to:
writing the xml file according to the pre-adding function to show the description information of each part of the components in the plug-in;
defining reference relationships for the respective parts of the components in the plug-in.
9. The apparatus of claim 6, wherein the setup module is further configured to:
defining a data source of data required by the plug-in;
setting specific information of a data source;
and acquiring specific data through the data source, and integrating the acquired data source based on the specific information.
10. The apparatus of claim 9, wherein the data sources comprise third party provided data sources and data sources of the MVC network.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010445402.8A CN111708583A (en) | 2020-05-24 | 2020-05-24 | Method and equipment for plug-in application of MVC (model view controller) network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010445402.8A CN111708583A (en) | 2020-05-24 | 2020-05-24 | Method and equipment for plug-in application of MVC (model view controller) network |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111708583A true CN111708583A (en) | 2020-09-25 |
Family
ID=72538072
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010445402.8A Withdrawn CN111708583A (en) | 2020-05-24 | 2020-05-24 | Method and equipment for plug-in application of MVC (model view controller) network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111708583A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114356468A (en) * | 2021-11-24 | 2022-04-15 | 上海欣兆阳信息科技有限公司 | User interface integration system and protocol-based user interface access mode in integration thereof |
-
2020
- 2020-05-24 CN CN202010445402.8A patent/CN111708583A/en not_active Withdrawn
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114356468A (en) * | 2021-11-24 | 2022-04-15 | 上海欣兆阳信息科技有限公司 | User interface integration system and protocol-based user interface access mode in integration thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109669692B (en) | Source code sharing method, server, computer readable storage medium and system | |
CN104834555A (en) | Method for invoking functional module, related device and device repairing method | |
CN107682426B (en) | Interface proxy method and application server | |
WO2020199594A1 (en) | Service component loading method and apparatus, and computer device and storage medium | |
CN110727724A (en) | Data extraction method and device, computer equipment and storage medium | |
CN114020840A (en) | Data processing method, device, server, storage medium and product | |
CN113157345A (en) | Automatic starting method and device for front-end engineering | |
CN111190609B (en) | Service processing method, device, equipment and storage medium | |
CN110765394A (en) | So file loading method and device, storage medium and terminal equipment | |
CN111708583A (en) | Method and equipment for plug-in application of MVC (model view controller) network | |
CN112214250B (en) | Application program component loading method and device | |
CN103500099A (en) | Method for achieving quick software secondary development through expansion points and expansion | |
CN114090070A (en) | Application program installation package file processing method and electronic equipment | |
CN111443945B (en) | Component code modification method and device | |
WO2024152742A1 (en) | Rich text editing method and apparatus, storage medium and computer device | |
CN110377367B (en) | Component configuration method and device, electronic terminal and computer readable storage medium | |
CN112965713A (en) | Development method, device and equipment of visual editor and storage medium | |
CN116048609A (en) | Configuration file updating method, device, computer equipment and storage medium | |
CN112445414B (en) | Data processing method and device | |
CN111142972B (en) | Method, apparatus, system, and medium for extending functions of application program | |
CN111459933B (en) | GDB data dynamic expansion method, device and storage medium | |
CN116701234B (en) | Application program debugging method and device, computer equipment and storage medium | |
CN109977659A (en) | Weblogic automatically creates method, system, device and the storage medium of local user | |
CN114035867B (en) | Method for expanding interaction behavior and computer readable medium | |
CN117032779A (en) | Application version switching method, device, computer equipment and storage medium |
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 | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20200925 |