CN108804197B - Dynamic componentization implementation method, device, equipment and storage medium - Google Patents

Dynamic componentization implementation method, device, equipment and storage medium Download PDF

Info

Publication number
CN108804197B
CN108804197B CN201810630759.6A CN201810630759A CN108804197B CN 108804197 B CN108804197 B CN 108804197B CN 201810630759 A CN201810630759 A CN 201810630759A CN 108804197 B CN108804197 B CN 108804197B
Authority
CN
China
Prior art keywords
component
data management
management model
data
creating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810630759.6A
Other languages
Chinese (zh)
Other versions
CN108804197A (en
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.)
Beijing 58 Information Technology Co Ltd
Original Assignee
Beijing 58 Information Technology 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 Beijing 58 Information Technology Co Ltd filed Critical Beijing 58 Information Technology Co Ltd
Priority to CN201810630759.6A priority Critical patent/CN108804197B/en
Publication of CN108804197A publication Critical patent/CN108804197A/en
Application granted granted Critical
Publication of CN108804197B publication Critical patent/CN108804197B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method, a device, equipment and a storage medium for realizing dynamic componentization, wherein the method comprises the following steps: after a page is created, acquiring a data protocol formulated for each component in the page from a server; respectively creating a component data management model example for managing the component state for each component according to the data protocol of each component; and creating each component, and binding each created component with the corresponding component data management model instance. The invention realizes that the service condition of the component is modified by adjusting the data protocol of the component stored in the background server and utilizing the component data management model for managing the component state under the condition of not updating the package.

Description

Dynamic componentization implementation method, device, equipment and storage medium
Technical Field
The invention relates to the field of page development, in particular to a dynamic componentization implementation method, a dynamic componentization implementation device, dynamic componentization implementation equipment and a storage medium.
Background
In page development, development of components is firstly carried out, then the components are directly introduced by code based on an original framework provided by ReactNative (cross-platform mobile application development framework), and then nesting and attribute configuration of the components are completed in rendering logic of a page. When some components need to be reused in another page, they are referenced again, implementing new nesting and property configuration logic in the new page.
However, because the original framework has no dynamic configuration characteristic, for a page containing a plurality of components, the usage of the components is determined in advance, so that the developed page cannot adjust the usage of the components without updating the package.
Disclosure of Invention
In view of the foregoing, embodiments of the present invention are provided to provide a method, an apparatus, a device, and a storage medium for implementing dynamic componentization.
According to an aspect of an embodiment of the present invention, there is provided a dynamic componentization implementation method, including:
after a page is created, acquiring a data protocol formulated for each component in the page from a server;
respectively creating a component data management model example for managing the component state for each component according to the data protocol of each component;
and creating each component, and binding each created component with the corresponding component data management model instance.
Optionally, the data protocol includes: component identification and component status data.
Optionally, the creating, according to the data protocol of each component, a component data management model instance for managing a component state for each component respectively includes:
searching a pre-configured first configuration table according to the component identification contained in the data protocol of each component, and acquiring the type of the component data management model corresponding to the component identification;
and creating the component data management model instance according to the type of the component data management model, and setting component state data contained in the data protocol into the data management model instance.
Optionally, the creating the components includes:
searching a component type corresponding to the component identifier in a pre-configured second configuration table according to the component identifier of each component;
the components are created according to the component types.
Optionally, the binding the created components with the corresponding component data management model instances specifically includes:
and in the rendering logic of the page, binding each created component with the corresponding component data management model instance, so that each created component takes component state data from the bound component data management model instance to perform component rendering.
Optionally, before the page is created, the method further includes:
and creating a first configuration table, wherein the first configuration table comprises the types of the component data management models which are registered in the configuration table according to the component identifiers after the components are developed.
Optionally, before the page is created, the method further includes:
and creating a second configuration table, wherein the second configuration table comprises the component types which are registered in the configuration table according to the component identifiers after the components are developed.
Optionally, the process of developing the component comprises:
creating a component and creating a component data management model for the component, wherein the component data management model is used for managing the state of the component;
according to a set data protocol format, formulating the data protocol for the component;
developing the component and the component data management model, and binding the component state in the component data management model with the component in the rendering logic of the component.
According to a second aspect of the embodiments of the present invention, there is provided a dynamic componentization implementation apparatus, including:
the data acquisition module is used for acquiring a data protocol formulated for each component in the page from a server after the page is created;
the first processing module is used for respectively creating component data management model examples for managing the component states for the components according to the data protocols of the components;
the second processing module is used for creating each component;
and the third processing module is used for binding each created component with the corresponding component data management model instance.
Optionally, the data protocol includes: component identification and component status data.
Optionally, the first processing module is specifically configured to search a pre-configured first configuration table according to the component identifier included in the data protocol of each component, and obtain a type of the component data management model corresponding to the component identifier; and creating the component data management model instance according to the type of the component data management model, and setting component state data contained in the data protocol into the data management model instance.
Optionally, the second processing module is configured to search, according to the component identifier of each component, a component type corresponding to the component identifier in a second pre-configured configuration table, and create a component according to the component type.
Optionally, the third processing module is specifically configured to, in the rendering logic of the page, bind each created component with the corresponding component data management model instance, so that each created component takes component state data from the bound component data management model instance to perform component rendering.
Optionally, the apparatus further comprises: a first configuration module;
the first configuration module is used for creating a first configuration table before page creation, and the first configuration table comprises the types of the component data management models which are registered in the configuration table according to the component identifiers after components are developed.
Optionally, the apparatus further comprises: a second configuration module;
the second configuration module is used for creating a second configuration table before the page is created, and the second configuration table comprises component types which are registered in the configuration table according to the component identifiers after the components are developed.
Optionally, the apparatus further comprises:
the component development module is used for creating components and creating a component data management model for managing the component state for the components; according to a set data protocol format, formulating the data protocol for the component; and developing the component and the component data management model, and binding the component state in the component data management model with the component in the rendering logic of the component.
According to a third aspect of embodiments of the present invention, there is provided a computing device, comprising: a memory, a processor, and a communication bus; the communication bus is used for realizing connection communication between the processor and the memory;
the processor is configured to execute a dynamic componentization implementation program stored in the memory to implement the method steps of:
after a page is created, acquiring a data protocol formulated for each component in the page from a server;
respectively creating a component data management model example for managing the component state for each component according to the data protocol of each component;
and creating each component, and binding each created component with the corresponding component data management model instance.
According to a fourth aspect of embodiments of the present invention, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method steps of:
after a page is created, acquiring a data protocol formulated for each component in the page from a server;
respectively creating a component data management model example for managing the component state for each component according to the data protocol of each component;
and creating each component, and binding each created component with the corresponding component data management model instance.
According to the dynamic componentization implementation scheme provided by the embodiment of the invention, the data management model of the component is established according to the data protocol of the component, and the model is bound with the component, so that the management of the component state by using the data management model is realized. Therefore, the use condition of the component is modified by adjusting the data protocol of the component stored by the background server and utilizing the component data management model for managing the component state under the condition of not updating the package, and the use condition of the component does not need to be determined in advance.
The foregoing description is only an overview of the technical solutions of the embodiments of the present invention, and the embodiments of the present invention can be implemented according to the content of the description in order to make the technical means of the embodiments of the present invention more clearly understood, and the detailed description of the embodiments of the present invention is provided below in order to make the foregoing and other objects, features, and advantages of the embodiments of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the embodiments of the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart of a dynamic componentization implementation method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a dynamic componentization implementation method according to a second embodiment of the present invention;
FIG. 3 is a flowchart of a dynamic componentization implementation method according to a third embodiment of the present invention;
fig. 4 is a block diagram illustrating a dynamic componentization implementation apparatus according to a fifth embodiment of the present invention;
fig. 5 is a block diagram of a dynamic componentization implementation apparatus according to a sixth embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In a first embodiment of the present invention, a dynamic componentization implementation method is provided, and more specifically, a dynamic componentization implementation method based on the ReactNative is provided, and is optionally applied to a page development phase.
As shown in fig. 1, the method of this embodiment includes the following steps:
step S101, after a page is created, acquiring a data protocol formulated for each component in the page from a server;
in the embodiment of the present invention, the page may be, but is not limited to, a page that can be loaded by an application program.
In the embodiment of the invention, the format of the data protocol can be flexibly configured according to the requirement, and the invention does not limit the format only.
The data protocol includes at least component state data. The component status data mainly refers to data to be displayed in the component, such as an address, a color, and the like of a picture to be displayed in the component.
Step S102, respectively creating component data management model examples for managing component states for each component according to the data protocol of each component;
in the embodiment of the invention, the data management model is an observable object under a MobX framework, the attribute in the object represents the state of the component, and meanwhile, the object is also responsible for providing an interface for other external environments to call so as to modify the state of the component. Therefore, in this embodiment, the role of the data management model is to manage the state of the components.
In the embodiment of the invention, in the component development stage, a corresponding data management model is created for each component, and the type of the data management model and the mapping relation among the components are established. Furthermore, after the page is created, a corresponding data management model instance can be created according to the type of the data management model corresponding to each component in the page.
In an exemplary embodiment, the type of component data management model is a class of methods that may create a component data management model.
And step S103, creating each component, and binding each created component and the corresponding component data management model instance.
In the embodiment of the invention, each component is created according to the type of the component determined in the component development stage. Wherein the type of component is, in an exemplary embodiment, a class of methods that create the component.
In the embodiment of the invention, in the rendering logic of the page, the created components are bound with the corresponding component data management model, so that the created components take component state data from the bound component data management model to render the components.
In summary, when the components in the page need to be adjusted, the page developed by the method according to the embodiment of the present invention only needs to adjust the data protocol of the components stored in the background server, and the adjusted state can be synchronized into the components based on the data management model instance created by the data protocol. The scheme of the embodiment of the invention supports that the service condition of the component is modified by using the component data management model for managing the component state under the condition of not updating the package, thereby increasing the dynamic characteristic of the original development framework.
In a second embodiment of the present invention, a dynamic componentization implementation method is provided, and more specifically, a dynamic componentization implementation method based on the ReactNative is provided, and is optionally applied to a page development phase.
As shown in fig. 2, the method of this embodiment includes the following steps:
step S201, after a page is created, acquiring a data protocol formulated for each component in the page from a server;
in the embodiment of the present invention, the page may be, but is not limited to, a page that can be loaded by an application program.
In the embodiment of the invention, the data protocol at least comprises component identification and component state data.
Wherein, the component identification is the unique identification created for the component in the component development stage. The component status data mainly refers to data to be presented in the component, for example, an address, a color, and the like of a picture to be presented in the component.
Step S202, according to the component identification contained in the data protocol of each component, searching a first configuration table configured in advance, and acquiring the type of the component data management model corresponding to the component identification;
step S203, according to the type of the component data management model, creating the component data management model instance, and setting the component state data contained in the data protocol into the data management model instance.
Step S204, searching a component type corresponding to the component identifier in a pre-configured second configuration table according to the component identifier of each component;
and step S205, creating components according to the component types, and binding each created component with the corresponding component data management model instance.
In the embodiment of the invention, in the rendering logic of the page, the created components are bound with the corresponding component data management model, so that the created components take component state data from the bound component data management model to render the components.
In summary, when the components in the page need to be adjusted, the page developed by the method according to the embodiment of the present invention only needs to adjust the data protocol of the components stored in the background server, and the adjusted state can be synchronized into the components based on the data management model instance created by the data protocol. The scheme of the embodiment of the invention supports that the service condition of the component is modified by using the component data management model for managing the component state under the condition of not updating the package, thereby increasing the dynamic characteristic of the original development framework.
In a third embodiment of the present invention, a dynamic componentization implementation method is provided, and more specifically, a dynamic componentization implementation method based on the ReactNative is provided, and is optionally applied to a page development phase.
As shown in fig. 3, the method of this embodiment includes the following steps:
step S301, a first configuration table and a second configuration table are created;
the first configuration table comprises the types of the component data management models which are registered in the configuration table according to the component identifiers after the components are developed; the second configuration table contains the component types which are registered in the configuration table according to the component identifiers after the components are developed.
Wherein the process of developing the component comprises:
creating a component and creating a component data management model for the component, wherein the component data management model is used for managing the state of the component;
according to a set data protocol format, establishing a data protocol for the component;
developing the component and the component data management model, and binding the component state in the component data management model with the component in the rendering logic of the component.
The process of developing the component and the component data management model can be understood as a process of developing specific business logic of the component and the component data management model.
In this embodiment, when creating a component, a unique identifier, that is, a component identifier is created for each component, and after the component is developed, the component type of the component and the type of the component data management model are registered in the corresponding configuration table by using the component identifier.
Step S302, after a page is created, a data protocol formulated for each component in the page is obtained from a server;
in the embodiment of the invention, the data protocol at least comprises component identification and component state data.
Wherein, the component identification is the unique identification created for the component in the component development stage. The component status data mainly refers to data to be presented in the component, for example, an address, a color, and the like of a picture to be presented in the component.
Step S303, searching a pre-configured first configuration table according to the component identifier contained in the data protocol of each component, and acquiring the type of the component data management model corresponding to the component identifier;
in an exemplary embodiment, the type of component data management model is a class of methods that may create a component data management model.
Step S304, according to the type of the component data management model, creating the component data management model instance, and setting the component state data contained in the data protocol into the data management model instance.
Step S305, searching a component type corresponding to the component identifier in a pre-configured second configuration table according to the component identifier of each component;
and step S306, creating components according to the component types, and binding the created components with the corresponding component data management model instances.
In the embodiment of the invention, in the rendering logic of the page, the created components are bound with the corresponding component data management model, so that the created components take component state data from the bound component data management model to render the components.
In summary, when the components in the page need to be adjusted, the page developed by the method according to the embodiment of the present invention only needs to adjust the data protocol of the components stored in the background server, and the adjusted state can be synchronized into the components based on the data management model instance created by the data protocol. The scheme of the embodiment of the invention supports that the service condition of the component is modified by using the component data management model for managing the component state under the condition of not updating the package, thereby increasing the dynamic characteristic of the original development framework.
In a fourth embodiment of the present invention, a dynamic componentization implementation method is provided, and this embodiment will describe the process of the embodiment of the present invention in more detail from two aspects.
Firstly, developing a page;
firstly, constructing a page development frame, specifically:
1. two configuration tables are created. One configuration table uses the unique identification of the component to configure the component type, and the other configuration table uses the unique identification of the component to configure the type of the component data management model; wherein, the component data management model is an observable object under a MobX framework. The role of this object is to manage the state of the component, hereinafter represented as a Model.
In the present embodiment, the form of the configuration table is exemplarily as follows:
{tag_a:ItemA,…}
{tag_a:ModelA,…}
wherein tag _ a is the unique identifier of the component, ItemA is the type of the component, and ModelA is the type of the model A.
2. The method realizes a factory class, which mainly comprises two functions: one is to retrieve the type of the component from the configuration table based on the component identification. And secondly, acquiring the type of the Model from the configuration table according to the component identifier contained in the data protocol of the page, and creating a corresponding Model instance.
3. And establishing a page data protocol for converting the Model for the factory class, and realizing a conversion process. Such as the following:
[{type:tag_a,data:{title:aaa}},
{type:tag_b,data:{title:bbb}},
{type:tag_c,data:{title:ccc}},…]
conversion to this form:
[ ModelA example, ModelB example, ModelC example, … ]
4. And creating a page and a corresponding page Model for managing the page state, and creating a factory instance for the page Model according to the factory class, wherein the factory instance is used for converting the data protocol of the component acquired from the background server into a component Model instance list.
5. And in the rendering logic of the page, traversing a component Model instance list in the page Model to acquire a component identifier, acquiring a component type by using a factory instance of the page Model according to the identifier, and binding the Model instance of the component with the component to finish the state binding of page rendering.
Based on the page development framework, component development is carried out, and the component development process comprises the following steps:
11. and creating a component and correspondingly creating a unique identifier and a Model for the component.
In this embodiment, each component (non-page component) is fixed with two attributes, one is its own data management model, and the other is the data management model of the page. One attribute, namely its own data management model, is fixed for page components (i.e., pages also correspond to components that belong to a parent component that contains multiple components).
In this embodiment, the purpose of the data management model of the page included in the attribute is that the component may find other components in the page through an interface provided by the data management model of the page, so as to modify the states of the other components.
12. And establishing a corresponding background data protocol for the component. Such as the following:
{type:tag_a,data:{title:aaa}}
where tag _ a is the component identification and { title: aaa } is the component status data.
13. And developing the component and the component Model, and binding the state of the component Model and the component in the rendering logic of the component to finish the rendering logic of the component.
14. And registering the components and the component models into a configuration table according to the identifiers to complete the development of one component.
Steps 11-14 are continued to develop other components.
Secondly, the page development by using the page development frame specifically comprises the following steps:
step 1, creating a page;
step 2, establishing a page Model;
step 3, establishing a factory instance for the page Model according to the factory class;
step 4, acquiring a data protocol of each component in the page from the server;
step 5, the factory instance acquires the type of the component Model from the configuration table according to the component identifier of each component included in the data protocol of each component, creates a corresponding Model instance according to the type of the component Model, and sets component state data included in the data protocol into the corresponding Model instance to obtain a Model instance list;
step 6, triggering page rendering;
step 7, traversing the Model instance list by the factory instance, and taking out the component identifier;
8, acquiring the type of the corresponding component from the configuration table by the factory instance according to the component identifier;
step 9, creating the component according to the type of the component;
step 10, binding the module instance with the corresponding module;
and step 11, the component acquires data from the component Model to perform component rendering.
According to the scheme, the dynamic characteristic is added on the basis of the original ReactNative framework, and the use condition of the component is modified through adjustment of a background data protocol without updating the RN packet without determining in advance. And moreover, the components and the pages do not have dependency relationship, so that the number of the pages used is not required to be concerned when the components are modified, the components are directly modified, and the maintenance cost is reduced.
In addition, in the embodiment, after the dynamic framework is built, only the realization of the component and the realization of the Model of the component are concentrated, the use condition of the page is not concerned, the new page development only needs to apply the configuration scheme, the realization of the component is not concerned, and the development efficiency is greatly improved. The method and the device solve the problems that when the components are multiplexed, the nesting and attribute configuration of the components must be realized again by each newly-built page, so that the repeated workload is increased, and the development efficiency is low in the prior art.
In a fifth embodiment of the present invention, there is provided a dynamic componentization implementation apparatus, as shown in fig. 4, including:
a data obtaining module 410, configured to obtain, from a server, a data protocol formulated for each component in a page after the page is created;
a first processing module 420, configured to create, according to the data protocol of each component, a component data management model instance for managing a component state for each component;
a second processing module 430, configured to create the components;
and the third processing module 440 is configured to bind each created component with the corresponding component data management model instance.
Optionally, in this embodiment of the present invention, the third processing module 440 is specifically configured to, in the rendering logic of the page, bind each created component with the corresponding component data management model instance, so that each created component takes component state data from the bound component data management model instance to perform component rendering.
Optionally, in this embodiment of the present invention, the data protocol includes: component identification and component status data.
In the embodiment of the invention, the format of the data protocol can be flexibly configured according to the requirement, and the invention does not limit the format only. Wherein, the component identification is the unique identification created for the component in the component development stage. The component status data mainly refers to data to be presented in the component, for example, an address, a color, and the like of a picture to be presented in the component.
In summary, when the page developed by the device according to the embodiment of the present invention needs to adjust the components in the page, only the data protocol of the components stored in the background server needs to be adjusted, and the adjusted state can be synchronized into the components based on the data management model instance created by the data protocol. The scheme of the embodiment of the invention supports that the service condition of the component is modified by using the component data management model for managing the component state under the condition of not updating the package, thereby increasing the dynamic characteristic of the original development framework.
In a sixth embodiment of the present invention, there is provided a dynamic componentization implementation apparatus, as shown in fig. 5, including:
the first configuration module 510 is configured to create a first configuration table, where the first configuration table includes types of component data management models that are registered in the configuration table according to component identifiers after components are developed.
A second configuration module 520, configured to create a second configuration table, where the second configuration table includes component types that are registered in the configuration table according to the component identifiers after the components are developed.
A data obtaining module 530, configured to obtain, from a server, a data protocol formulated for each component in a page after the page is created;
a first processing module 540, configured to search a pre-configured first configuration table according to the component identifier included in the data protocol of each component, and obtain a type of a component data management model corresponding to the component identifier; and creating the component data management model instance according to the type of the component data management model, and setting component state data contained in the data protocol into the data management model instance.
The second processing module 550 is configured to search, according to the component identifier of each component, a component type corresponding to the component identifier in a second pre-configured configuration table, and create a component according to the component type.
And a third processing module 560, configured to bind each created component with the corresponding component data management model instance.
Optionally, the third processing module 560, in the rendering logic of the page, binds each created component with the corresponding component data management model instance, so that each created component takes component state data from the bound component data management model instance to perform component rendering.
In an exemplary embodiment, the type of component data management model is a class of methods that may create a component data management model.
In an exemplary embodiment of the invention, the type of component is a class of methods that create the component.
Optionally, the apparatus in the embodiment of the present invention further includes:
the component development module 570 is used for creating components and creating a component data management model for managing the component states for the components; according to a set data protocol format, formulating the data protocol for the component; and developing the component and the component data management model, and binding the component state in the component data management model with the component in the rendering logic of the component.
In summary, when the page developed by the device according to the embodiment of the present invention needs to adjust the components in the page, only the data protocol of the components stored in the background server needs to be adjusted, and the adjusted state can be synchronized into the components based on the data management model instance created by the data protocol. The scheme of the embodiment of the invention supports that the service condition of the component is modified by using the component data management model for managing the component state under the condition of not updating the package, thereby increasing the dynamic characteristic of the original development framework.
In a seventh embodiment of the present invention, there is provided a computing device comprising: a memory, a processor, and a communication bus; the communication bus is used for realizing connection communication between the processor and the memory;
the processor is configured to execute a dynamic componentization implementation program stored in the memory to implement the method steps of:
step 1, after a page is created, acquiring a data protocol formulated for each component in the page from a server;
step 2, respectively establishing a component data management model instance for managing the component state for each component according to the data protocol of each component;
and 3, creating each component, and binding each created component with the corresponding component data management model instance.
The detailed implementation process of the above steps can be referred to in the first to fourth embodiments, and this embodiment is not described herein again.
In an eighth embodiment of the invention, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, realizes the method steps of:
step 1, after a page is created, acquiring a data protocol formulated for each component in the page from a server;
step 2, respectively establishing a component data management model instance for managing the component state for each component according to the data protocol of each component;
and 3, creating each component, and binding each created component with the corresponding component data management model instance.
The detailed implementation process of the above steps can be referred to in the first to fourth embodiments, and this embodiment is not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In short, the above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A dynamic componentization implementation method is characterized by comprising the following steps:
after a page is created, acquiring a data protocol formulated for each component in the page from a server;
respectively creating a component data management model example for managing the component state for each component according to the data protocol of each component;
creating each component, and binding each created component with the corresponding component data management model instance;
before the page is created, the method further comprises:
creating a first configuration table, wherein the first configuration table comprises the types of the component data management models which are registered in the configuration table according to the component identifiers after the components are developed; and/or creating a second configuration table, wherein the second configuration table comprises component types which are registered in the configuration table according to the component identifiers after the components are developed;
wherein the process of developing the component comprises:
creating a component and creating a component data management model for the component, wherein the component data management model is used for managing the state of the component;
according to a set data protocol format, formulating the data protocol for the component;
developing the component and the component data management model, and binding the component state in the component data management model with the component in the rendering logic of the component.
2. The method of claim 1, wherein the data protocol comprises: component identification and component status data.
3. The method of claim 2, wherein said creating a component data management model instance for managing component states for said components, respectively, according to said component's data protocol, comprises:
searching a pre-configured first configuration table according to the component identification contained in the data protocol of each component, and acquiring the type of the component data management model corresponding to the component identification;
and creating the component data management model instance according to the type of the component data management model, and setting component state data contained in the data protocol into the data management model instance.
4. The method of claim 2, wherein said creating said components comprises:
searching a component type corresponding to the component identifier in a pre-configured second configuration table according to the component identifier of each component;
the components are created according to the component types.
5. The method according to any one of claims 1 to 4, wherein the binding of each created component with the corresponding component data management model instance specifically comprises:
and in the rendering logic of the page, binding each created component with the corresponding component data management model instance, so that each created component takes component state data from the bound component data management model instance to perform component rendering.
6. A dynamic componentization implementation apparatus, comprising:
the data acquisition module is used for acquiring a data protocol formulated for each component in the page from a server after the page is created;
the first processing module is used for respectively creating component data management model examples for managing the component states for the components according to the data protocols of the components;
the second processing module is used for creating each component;
the third processing module is used for binding each created component with the corresponding component data management model instance;
the device further comprises: a first configuration module and/or a second configuration module; the first configuration module is used for creating a first configuration table before page creation, and the first configuration table comprises the types of the component data management models which are registered in the configuration table according to the component identifiers after components are developed; the second configuration module is used for creating a second configuration table before the page is created, and the second configuration table comprises component types which are registered in the configuration table according to the component identifiers after the components are developed;
the device further comprises: the component development module is used for creating components and creating a component data management model for managing the component state for the components; according to a set data protocol format, formulating the data protocol for the component; and developing the component and the component data management model, and binding the component state in the component data management model with the component in the rendering logic of the component.
7. The apparatus of claim 6, wherein the data protocol comprises: component identification and component status data.
8. The apparatus according to claim 7, wherein the first processing module is specifically configured to search a preconfigured first configuration table according to a component identifier included in the data protocol of each component, and obtain a type of a component data management model corresponding to the component identifier; and creating the component data management model instance according to the type of the component data management model, and setting component state data contained in the data protocol into the data management model instance.
9. The apparatus of claim 7, wherein the second processing module is configured to look up a component type corresponding to the component identifier in a second pre-configured configuration table according to the component identifier of each component, and create a component according to the component type.
10. The apparatus according to any one of claims 6 to 9, wherein the third processing module is specifically configured to, in the rendering logic of the page, bind each created component with the corresponding component data management model instance, so that each created component takes component state data from the bound component data management model instance to perform component rendering.
11. A computing device, wherein the computing device comprises: a memory, a processor, and a communication bus; the communication bus is used for realizing connection communication between the processor and the memory;
the processor is used for executing the dynamic componentization implementation program stored in the memory to implement the steps of the dynamic componentization implementation method according to any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, implements the steps of the dynamic componentization implementation method according to one of the claims 1 to 5.
CN201810630759.6A 2018-06-19 2018-06-19 Dynamic componentization implementation method, device, equipment and storage medium Active CN108804197B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810630759.6A CN108804197B (en) 2018-06-19 2018-06-19 Dynamic componentization implementation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810630759.6A CN108804197B (en) 2018-06-19 2018-06-19 Dynamic componentization implementation method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108804197A CN108804197A (en) 2018-11-13
CN108804197B true CN108804197B (en) 2022-04-05

Family

ID=64083483

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810630759.6A Active CN108804197B (en) 2018-06-19 2018-06-19 Dynamic componentization implementation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108804197B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109683884A (en) * 2018-12-25 2019-04-26 福建南威软件有限公司 A kind of cloud application modular assembly method
CN111857929B (en) * 2020-07-23 2023-05-30 杭州海康威视数字技术股份有限公司 Method and device for displaying application program interface and computer equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105574049A (en) * 2014-10-30 2016-05-11 阿里巴巴集团控股有限公司 Page processing method, device and system of mobile applications
CN105760149A (en) * 2014-12-18 2016-07-13 阿里巴巴集团控股有限公司 Client-terminal-interface dynamic display method and system
CN105955723A (en) * 2016-04-21 2016-09-21 人人行科技股份有限公司 Method and device for processing cross-platform application of mobile terminal
CN106528601A (en) * 2016-09-23 2017-03-22 北京五八信息技术有限公司 Method and device for dynamically configuring module
CN106843850A (en) * 2016-12-28 2017-06-13 北京五八信息技术有限公司 A kind of method and apparatus that native objects are transmitted between React Native components
CN107291482A (en) * 2016-03-30 2017-10-24 阿里巴巴集团控股有限公司 The display methods and device of content of pages in application program
US20170329746A1 (en) * 2016-05-12 2017-11-16 Alibaba Group Holding Limited Page component dynamic layout
CN107391114A (en) * 2017-06-27 2017-11-24 阿里巴巴集团控股有限公司 The page visualizes rendering intent and device
CN108121539A (en) * 2016-11-28 2018-06-05 北京国双科技有限公司 Component processing method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105574049A (en) * 2014-10-30 2016-05-11 阿里巴巴集团控股有限公司 Page processing method, device and system of mobile applications
CN105760149A (en) * 2014-12-18 2016-07-13 阿里巴巴集团控股有限公司 Client-terminal-interface dynamic display method and system
CN107291482A (en) * 2016-03-30 2017-10-24 阿里巴巴集团控股有限公司 The display methods and device of content of pages in application program
CN105955723A (en) * 2016-04-21 2016-09-21 人人行科技股份有限公司 Method and device for processing cross-platform application of mobile terminal
US20170329746A1 (en) * 2016-05-12 2017-11-16 Alibaba Group Holding Limited Page component dynamic layout
CN106528601A (en) * 2016-09-23 2017-03-22 北京五八信息技术有限公司 Method and device for dynamically configuring module
CN108121539A (en) * 2016-11-28 2018-06-05 北京国双科技有限公司 Component processing method and device
CN106843850A (en) * 2016-12-28 2017-06-13 北京五八信息技术有限公司 A kind of method and apparatus that native objects are transmitted between React Native components
CN107391114A (en) * 2017-06-27 2017-11-24 阿里巴巴集团控股有限公司 The page visualizes rendering intent and device

Also Published As

Publication number Publication date
CN108804197A (en) 2018-11-13

Similar Documents

Publication Publication Date Title
CN107463418B (en) Configuration file generation method and device for server middleware
US7493377B2 (en) Method and apparatus to manage a configuration of clustered computers according to deployment date structures
US8127270B1 (en) Abstracting transformation for model driven architecture
US10817284B2 (en) Melding of mediation flow service component architecture (SCA) components
CN103077024A (en) Device and method for supporting customization and running of software-as-a-service (SaaS) application processes
CN111787126B (en) Container creation method, server, and storage medium
CN108804197B (en) Dynamic componentization implementation method, device, equipment and storage medium
CN111143446A (en) Data structure conversion processing method and device of data object and electronic equipment
CN113766042A (en) Container address configuration method, system, device, equipment and medium
CN110955715A (en) ERP system, data conversion method and device of target platform and electronic equipment
CN112698930A (en) Method, device, equipment and medium for obtaining server identification
CN116466915A (en) MVP architecture-based iOS development framework construction method and device
CN113467817B (en) Application management method, system, medium and electronic terminal
CN102799423A (en) Method and device for implementing dynamic method in JSF (java service face)
CN114490318A (en) Environment management system and method for realizing weak isolation based on bytecode enhancement
CN104503716A (en) Method and system for printing code picture
CN114675940A (en) Application instance construction method, device and equipment
CN113904859A (en) Security group source group information management method and device, storage medium and electronic equipment
CN109995854B (en) Scheduling method, scheduling device, electronic equipment and storage medium
CN109359384B (en) Method and device for calling silk-screen mark into printed circuit board
CN117520019B (en) Component communication method and device
CN112579312A (en) Parameter mapping method and device, storage medium, interface calling platform and service system
CN113434598B (en) Method, device and electronic device for realizing data double writing
EP4191407A1 (en) Method and device for generating and registering ui service package and loading ui service
JP2014229114A (en) OSGi SERVICE REGISTRATION DEVICE, REGISTRATION METHOD AND REGISTRATION PROGRAM

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant