A method and device for developing an MVP architecture, an electronic device, and a storage medium

By automatically generating MVP architecture development code, the problem of low development efficiency of MVP architecture is solved, and the automation and standardization of code are achieved, thereby improving development efficiency.

CN113467763BActive Publication Date: 2026-02-03北京自如信息科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110806398.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-16
Publication Date
2026-02-03
Estimated Expiration
2041-07-16

AI Technical Summary

Technical Problem

The MVP architecture is inefficient, requiring developers to write a lot of repetitive code, which leads to low development efficiency.

Method used

By obtaining the attribute information of the target module components and the name and relative path of the view class to be developed, the MVP folder is automatically created, and the MVP architecture development code is generated according to the preset specifications, including the code of the view class, contract class and presenter layer, and the data communication interface between the view layer and the presenter layer is automatically established.

Benefits of technology

It improves the development efficiency of the MVP architecture, reduces the manual coding work of developers, realizes code automation and standardization, and simplifies the introduction and maintenance of the project.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113467763B_ABST
    Figure CN113467763B_ABST
Patent Text Reader

Abstract

The application provides an MVP architecture development method and device, electronic equipment and a storage medium. The method comprises the following steps: obtaining attribute information of a target module component, and a name and a relative path of a to-be-developed view class; creating an MVP folder under a target module component directory according to the attribute information of the target module component and the name and the relative path of the to-be-developed view class; determining a prefix code of MVP architecture development code according to the name of the to-be-developed view class; and generating the MVP architecture development code of the target module component under the MVP folder according to the prefix code of the MVP architecture development code according to a preset writing specification of the MVP architecture development code. The method provided by the above scheme automatically generates the MVP architecture development code that meets the writing specification of the MVP architecture development code, and the developer does not need to manually write the code, thereby improving the development efficiency of the MVP architecture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an MVP architecture development method, apparatus, electronic device, and storage medium. Background Technology

[0002] Currently, the three most popular Android frameworks are MVC, MVP, and MVVM. However, as development projects become larger and more developers participate, the drawbacks of the MVC pattern, such as its excessive complexity and low development efficiency, become apparent. Modern Android project development is moving towards modularity, loose coupling, and high cohesion, and using the MVP pattern for Android project development is now very common.

[0003] However, one drawback of MVP is that it is too formulaic. Developers have to write a lot of helper classes every time they design a page, which means that developers always have to write a lot of repetitive code during the development process, reducing the development efficiency of the MVP architecture. Summary of the Invention

[0004] This application provides an MVP architecture development method, apparatus, electronic device, and storage medium to address the shortcomings of low development efficiency in existing MVP architectures.

[0005] The first aspect of this application provides an MVP architecture development method, including:

[0006] Obtain the attribute information of the target module component and the name and relative path of the view class to be developed;

[0007] Based on the attribute information of the target module component and the name and relative path of the view class to be developed, create an MVP folder in the target module component directory;

[0008] Determine the prefix code of the MVP architecture development code based on the name of the view class to be developed;

[0009] Following the preset MVP architecture development code writing specifications, and based on the prefix code of the MVP architecture development code, the MVP architecture development code of the target module component is generated in the MVP folder.

[0010] Optionally, the method further includes:

[0011] According to the preset layout file generation specifications, the layout files of the view classes developed by the MVP architecture development code are generated in the layout folder.

[0012] Optionally, the method further includes:

[0013] Based on the structure of the view class developed using the MVP architecture development code, determine whether to register the view class in the Android configuration manifest.

[0014] Optionally, determining whether to register the view class to the Android configuration manifest based on the structure of the view class developed according to the MVP architecture development code includes:

[0015] When the view class is an Activity structure, the view class is registered in the Android configuration manifest.

[0016] Optionally, the step of generating the MVP architecture development code for the target module component in the MVP folder according to the preset MVP architecture development code writing specifications and the prefix code of the MVP architecture development code includes:

[0017] Following the pre-defined MVP architecture code writing guidelines, view class development code, contract class development code, and presenter layer development code with the prefix code are generated in the MVP folder to obtain logically bound view classes, contract classes, and presenter layers.

[0018] Optionally, the method further includes:

[0019] The view class references the instance object in the Presenter layer to establish a data communication interface between the View layer and the Presenter layer.

[0020] Optionally, the attribute information of the target module component may include at least the name of the target module component.

[0021] The second aspect of this application provides an MVP architecture development apparatus, comprising:

[0022] The module retrieval function is used to obtain the attribute information of the target module component and the name and relative path of the view class to be developed.

[0023] The folder creation module is used to create an MVP folder in the target module component directory based on the target module component's attribute information and the name and relative path of the view class to be developed;

[0024] The determination module is used to determine the prefix code of the MVP architecture development code based on the name of the view class to be developed;

[0025] The development module is used to generate the MVP architecture development code of the target module component in the MVP folder according to the preset MVP architecture development code writing specifications and the prefix code of the MVP architecture development code.

[0026] Optionally, the device further includes:

[0027] The layout file generation module is used to generate layout files for the view classes developed by the MVP architecture development code in the layout folder according to the preset layout file generation specifications.

[0028] Optionally, the device further includes:

[0029] The registration module is used to determine whether to register the view class to the Android configuration manifest based on the structure of the view class developed by the MVP architecture development code.

[0030] Optionally, the registration module is specifically used for:

[0031] When the view class is an Activity structure, the view class is registered in the Android configuration manifest.

[0032] Optionally, the development module is specifically used for:

[0033] Following the pre-defined MVP architecture code writing guidelines, view class development code, contract class development code, and presenter layer development code with the prefix code are generated in the MVP folder to obtain logically bound view classes, contract classes, and presenter layers.

[0034] Optionally, the device further includes:

[0035] The control module is used to control the view class to reference the instance object in the Presenter layer in order to establish a data communication interface between the View layer and the Presenter layer.

[0036] Optionally, the attribute information of the target module component may include at least the name of the target module component.

[0037] A third aspect of this application provides an electronic device, comprising: at least one processor and a memory;

[0038] The memory stores computer-executed instructions;

[0039] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method described in the first aspect above and various possible designs of the first aspect.

[0040] The fourth aspect of this application provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the method described in the first aspect above and various possible designs of the first aspect.

[0041] The technical solution of this application has the following advantages:

[0042] The MVP architecture development method, apparatus, electronic device, and storage medium provided in this application obtain the attribute information of the target module component and the name and relative path of the view class to be developed; create an MVP folder in the target module component directory based on the attribute information of the target module component and the name and relative path of the view class to be developed; determine the prefix code of the MVP architecture development code based on the name of the view class to be developed; and generate the MVP architecture development code of the target module component in the MVP folder according to the prefix code and a preset MVP architecture development code writing specification. The method provided by the above solution improves the development efficiency of MVP architecture by automatically generating MVP architecture development code that conforms to the MVP architecture development code writing specification, eliminating the need for developers to manually write code. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.

[0044] Figure 1 This is a schematic diagram of the structure of the MVP architecture development system on which the embodiments of this application are based;

[0045] Figure 2 A flowchart illustrating an MVP architecture development method provided in this application embodiment;

[0046] Figure 3 A flowchart illustrating another MVP architecture development method provided in this application embodiment;

[0047] Figure 4 A schematic diagram illustrating the overall process of an exemplary MVP architecture development method provided in this application embodiment;

[0048] Figure 5 This is a schematic diagram of the structure of the MVP architecture development device provided in the embodiments of this application;

[0049] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0050] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the present disclosure in any way, but rather to illustrate the concepts of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0052] Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. In the following descriptions of embodiments, "a plurality of" means two or more, unless otherwise explicitly defined.

[0053] The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.

[0054] First, the structure of the MVP architecture development system on which this application is based will be described:

[0055] The MVP architecture development method, apparatus, electronic device, and storage medium provided in this application are suitable for automatically generating MVP architecture development code for users. Figure 1 The diagram shows the structure of the MVP architecture development system based on the embodiments of this application. It mainly includes a configuration device and an MVP architecture development device for developing the MVP architecture. Specifically, the user can send configuration information to the MVP architecture development device through the configuration device to configure the parameters of the MVP architecture development device. The configuration information mainly includes the attribute information of the target module components and the name and relative path of the view class to be developed. Based on the obtained configuration information, the MVP architecture development device generates corresponding MVP architecture development code for the user to achieve automatic development of the MVP architecture.

[0056] This application provides an MVP architecture development method for automatically generating MVP architecture development code. The execution subject of this application embodiment is an electronic device, such as a server, desktop computer, laptop computer, tablet computer, and other electronic devices that can be used for automatic code generation.

[0057] like Figure 2 The diagram shown is a flowchart illustrating an MVP architecture development method provided in an embodiment of this application. The method includes:

[0058] Step 201: Obtain the attribute information of the target module component and the name and relative path of the view class to be developed.

[0059] It's worth noting that in Android application development, a component-based development model is typically used to improve development efficiency. This involves dividing the entire application project into a main project and multiple sub-components (module components), with each module component corresponding to a specific application function. For example, in developing an e-commerce application, the one-click checkout function in the shopping cart could be designated as a module component.

[0060] The attribute information of the target module component includes at least its name, and may also include its directory information and functional description. The name and relative path of the view class to be developed can be set by the user according to the actual project development situation; this embodiment does not impose such limitations.

[0061] Step 202: Based on the attribute information of the target module component and the name and relative path of the view class to be developed, create an MVP folder in the target module component directory.

[0062] Specifically, based on the name of the target module component, the target module component folder is located in the Android development files, and an MVP folder is created in the target module component folder according to the name and relative path of the view class to be developed set by the user. That is, an MVP folder is added under the target module component directory to store the MVP architecture development code.

[0063] Step 203: Determine the prefix code of the MVP architecture development code based on the name of the view class to be developed.

[0064] It should be noted that an MVP architecture includes multiple view classes, contract classes, and presenter layers, and there is a one-to-one correspondence between the view classes, contract classes, and presenter layers. For example, the first view class, the first contract class, and the first presenter layer constitute one set of components, and the second view class, the second contract class, and the second presenter layer constitute another set of components.

[0065] Specifically, in order to ensure that the correspondence between them conforms to the specifications, before generating the relevant code, the prefix code corresponding to each set of components is first determined, and the prefix code is used as the association identifier to establish the binding relationship between the view class, the contract class and the presenter layer.

[0066] Step 204: Following the preset MVP architecture development code writing specifications, generate the MVP architecture development code for the target module component in the MVP folder based on the prefix code of the MVP architecture development code.

[0067] It should be noted that the coding standards for MVP architecture development code can be set by referring to the MVP architecture development code manually written by developers. However, in different development scenarios, many details of MVP architecture development code need to be adapted, such as establishing the binding relationship between view classes, contract classes, and presenter layers.

[0068] Therefore, in order to automatically and adaptively adjust these details, corresponding MVP architecture development code can be generated according to different prefix codes, so that the generated MVP architecture development code can automatically complete the binding relationship between the view class, contract class and presenter layer.

[0069] Specifically, in one embodiment, the view class development code, contract class development code, and presenter layer development code with prefix codes can be generated in the MVP folder according to the preset MVP architecture development code writing specifications, so as to obtain logically bound view classes, contract classes, and presenter layers.

[0070] For example, if the MVP architecture development method provided in this application embodiment is encapsulated into an MVP architecture development plugin, the first step is to configure the mvpInfo plugin configuration file. The prePath field should be filled with "wireless" (this parameter is required when creating a component). For instance, the name of the target module component can be entered under modelPathName in the plugin configuration file, such as "housekeeperhire". Under modelName, the file prefix name can be entered, such as "hire" (prefix code). Under classPath, the relative address of the view class to be developed can be entered, such as (com.xxx.TextActivity). After configuring the MVP architecture development plugin, the view class development code, Contract class development code, and Presenter layer development code generated by the plugin will all have the prefix code "hire", such as hire_activity, hire_contract, and hire_presenter.

[0071] The plugin automatically resets the mvpinfo configuration file after use to prevent accidental code overwriting and to prevent other users from overwriting code after it has been committed via git.

[0072] It should be noted that in this embodiment of the application, TextActivity, TextPresenter and TextContract are generated in the MVP folder text, so the relative address of the view class to be developed can be com.xxx.TextActivity.

[0073] Furthermore, in one embodiment, to avoid null pointer issues caused by using the Presenter without initializing it, the view class can be controlled to reference the instance object in the Presenter layer to establish a data communication interface between the View layer and the Presenter layer.

[0074] It's important to note that the MVP architecture includes a Model layer, a View layer, and a Presenter layer. The Model layer, also the data layer, is responsible for data access operations, such as reading and writing to the database and requesting data from the network. The View layer is an interface for displaying data (the model) and passing user commands (events) to the presenter for application. The View typically contains a reference to the Presenter; in Android development, an Activity or Fragment is usually used as the View layer. The Presenter layer acts as a bridge between the View and Model layers and processes business logic. In the MVP architecture, the Model and View cannot interact directly. Therefore, the Presenter layer obtains the necessary data from the Model layer, performs appropriate processing, and then passes it to the View layer for display. This isolates the View and Model through the Presenter, decoupling them and extracting business logic from the View.

[0075] Specifically, for the newly developed MVP architecture, in order for the Presenter layer to provide data interaction services for the View and Model normally, the data communication interface between the View layer and the Presenter layer can be established by controlling the View class to reference the instance object in the Presenter layer. That is, the Activity (View layer) is controlled to automatically override the getPresenter method, thereby automatically realizing the binding relationship between the V layer and the P layer, while maintaining the interface integration relationship.

[0076] It should be further noted that the Contract class records information about some basic interfaces of the MVP architecture, but does not include the data communication interface mentioned above.

[0077] Based on the above embodiments, in order to further improve the development efficiency of the MVP architecture, such as...Figure 3 A flowchart illustrating another MVP architecture development method provided in this application embodiment. As an implementable approach, in one embodiment, the method further includes:

[0078] Step 301: According to the preset layout file generation specifications, generate the layout files of the view classes developed by the MVP architecture development code in the layout folder.

[0079] It's worth noting that layout files contain functional descriptions of each page in the view class files, allowing developers to determine which view class file to call. However, currently, layout files are typically created manually by developers who then store them in the layout folder, highlighting the tedious process of creating layout files.

[0080] Specifically, in order to reduce the workload of developers and improve the development efficiency of the MVP architecture, this embodiment of the application can encapsulate the layout file generation specification into the aforementioned MVP architecture development plugin. This allows the plugin to automatically generate layout files for the view classes developed by the MVP architecture development code in the layout folder according to the layout file generation specification. Furthermore, the layout files can be named according to the naming rules, such as hire_activity_text.xml.

[0081] Specifically, in one embodiment, in order to adapt to the Android application development scenario, the structure of the view class developed by the MVP architecture development code can be used to determine whether to register the view class to the Android configuration manifest.

[0082] Specifically, in one embodiment, when the view class is an Activity structure, the view class is registered to the Android configuration manifest.

[0083] It should be noted that in Android projects, Activities need to be registered in the Manifest, while Fragments do not.

[0084] Specifically, the view class developed in this application embodiment can be of Activity structure or Fragment structure. If the currently obtained view class is of Activity structure, the view class is registered to the Android configuration manifest. If the currently obtained view class is of Fragment structure or other structure, the above registration step can be omitted.

[0085] For example, such as Figure 4 The diagram shown is an overall flowchart illustrating an exemplary MVP architecture development method provided in this application embodiment. Wherein, as... Figure 4 The method shown is as follows Figure 2The method shown is an exemplary implementation, and the two implementations are based on the same principle, so they will not be described again.

[0086] The MVP architecture development method provided in this application involves: obtaining the attribute information of the target module component and the name and relative path of the view class to be developed; creating an MVP folder in the target module component directory based on the attribute information of the target module component and the name and relative path of the view class to be developed; determining the prefix code of the MVP architecture development code based on the name of the view class to be developed; and generating the MVP architecture development code of the target module component in the MVP folder according to the preset MVP architecture development code writing specifications and the prefix code. The method provided by the above solution automatically generates MVP architecture development code that conforms to the MVP architecture development code writing specifications, eliminating the need for developers to manually write code. This improves the development efficiency of the MVP architecture, facilitates its introduction into projects, makes code writing more standardized, secure, effective, and conducive to iterative development and maintenance. Furthermore, it can automatically register the Activity (view class) to the Manifest (Android configuration manifest) and automatically generate a layout file, greatly saving development time and achieving automated and intelligent code development.

[0087] This application provides an MVP architecture development apparatus for executing the MVP architecture development method provided in the above embodiments.

[0088] like Figure 5 The diagram shown is a structural schematic of the MVP architecture development device provided in this embodiment of the application. The MVP architecture development device 50 includes: an acquisition module 501, a folder creation module 502, a determination module 503, and a development module 504.

[0089] The module comprises the following components: an acquisition module, which acquires the attribute information of the target module component and the name and relative path of the view class to be developed; a folder creation module, which creates an MVP folder in the target module component directory based on the attribute information of the target module component and the name and relative path of the view class to be developed; a determination module, which determines the prefix code of the MVP architecture development code based on the name of the view class to be developed; and a development module, which generates the MVP architecture development code of the target module component in the MVP folder according to the preset MVP architecture development code writing specifications and the prefix code of the MVP architecture development code.

[0090] Specifically, in one embodiment, the apparatus further includes:

[0091] The layout file generation module is used to generate layout files for view classes developed using MVP architecture development code in the layout folder, according to preset layout file generation specifications.

[0092] Specifically, in one embodiment, the apparatus further includes:

[0093] The registration module is used to determine whether to register the view class to the Android configuration manifest based on the structure of the view class developed in the MVP architecture development code.

[0094] Specifically, in one embodiment, the registration module is specifically used for:

[0095] When the view class is an Activity structure, the view class is registered in the Android configuration manifest.

[0096] Specifically, in one embodiment, the development module is specifically used for:

[0097] Following the pre-defined MVP architecture code writing guidelines, generate view class development code, contract class development code, and presenter layer development code with prefix codes in the MVP folder to obtain logically bound view classes, contract classes, and presenter layers.

[0098] Specifically, in one embodiment, the apparatus further includes:

[0099] The control module is used to control the view class to reference the instance object in the Presenter layer, so as to establish a data communication interface between the View layer and the Presenter layer.

[0100] Specifically, in one embodiment, the attribute information of the target module component includes at least the name of the target module component.

[0101] Regarding the MVP architecture development apparatus in this embodiment, the specific methods by which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0102] The MVP architecture development apparatus provided in this application embodiment is used to execute the MVP architecture development method provided in the above embodiment. Its implementation method and principle are the same, and will not be described again.

[0103] This application provides an electronic device for executing the MVP architecture development method provided in the above embodiments.

[0104] like Figure 6 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application. The electronic device 60 includes at least one processor 61 and a memory 62.

[0105] The memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, causing the at least one processor to execute the MVP architecture development method provided in the above embodiment.

[0106] This application provides an electronic device for executing the MVP architecture development method provided in the above embodiments. Its implementation method and principle are the same, and will not be described again.

[0107] This application provides a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the MVP architecture development method provided in any of the above embodiments.

[0108] The storage medium containing computer-executable instructions in this embodiment can be used to store the computer-executable instructions of the MVP architecture development method provided in the foregoing embodiments. Its implementation method and principle are the same, and will not be described again.

[0109] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0110] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0111] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.

[0112] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0113] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is merely an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. An MVP architecture development method, characterized in that, include: Obtain the attribute information of the target module component and the name and relative path of the view class to be developed; Based on the attribute information of the target module component and the name and relative path of the view class to be developed, create an MVP folder in the target module component directory; Determine the prefix code of the MVP architecture development code based on the name of the view class to be developed; According to the preset MVP architecture development code writing specifications, and based on the prefix code of the MVP architecture development code, the MVP architecture development code of the target module component is generated in the MVP folder; The step of generating the MVP architecture development code for the target module component in the MVP folder according to the preset MVP architecture development code writing specifications and the prefix code of the MVP architecture development code includes: According to the preset MVP architecture code writing specifications, view class development code, contract class development code, and presenter layer development code with the prefix code are generated in the MVP folder to obtain logically bound view class, contract class, and presenter layer. The view class references the instance object in the Presenter layer to establish a data communication interface between the View layer and the Presenter layer.

2. The method according to claim 1, characterized in that, The method further includes: According to the preset layout file generation specifications, the layout files of the view classes developed by the MVP architecture development code are generated in the layout folder.

3. The method according to claim 1, characterized in that, The method further includes: Based on the structure of the view class developed using the MVP architecture development code, determine whether to register the view class in the Android configuration manifest.

4. The method according to claim 3, characterized in that, The structure of the view class developed based on the MVP architecture determines whether to register the view class in the Android configuration manifest, including: When the view class is an Activity structure, the view class is registered in the Android configuration manifest.

5. The method according to claim 1, characterized in that, The attribute information of the target module component includes at least the name of the target module component.

6. An MVP architecture development device, characterized in that, include: The module retrieval function is used to obtain the attribute information of the target module component and the name and relative path of the view class to be developed. The folder creation module is used to create an MVP folder in the target module component directory based on the target module component's attribute information and the name and relative path of the view class to be developed; The determination module is used to determine the prefix code of the MVP architecture development code based on the name of the view class to be developed; The development module is used to generate the MVP architecture development code of the target module component in the MVP folder according to the preset MVP architecture development code writing specifications and the prefix code of the MVP architecture development code. The development module is used for: According to the preset MVP architecture code writing specifications, view class development code, contract class development code, and presenter layer development code with the prefix code are generated in the MVP folder to obtain logically bound view class, contract class, and presenter layer. The view class references the instance object in the Presenter layer to establish a data communication interface between the View layer and the Presenter layer.

7. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Android MVP code automatic generation method and device, medium and electronic equipment

    CN110688145A

  • Android application development method and device based on MVPVM, equipment and medium

    CN111596906A