CN106569818A - Framework BMVVMFramework capable of quickly realizing MVVM mode - Google Patents
Framework BMVVMFramework capable of quickly realizing MVVM mode Download PDFInfo
- Publication number
- CN106569818A CN106569818A CN201610961596.0A CN201610961596A CN106569818A CN 106569818 A CN106569818 A CN 106569818A CN 201610961596 A CN201610961596 A CN 201610961596A CN 106569818 A CN106569818 A CN 106569818A
- Authority
- CN
- China
- Prior art keywords
- page
- data
- view
- list
- state
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
- G06F8/24—Object-oriented
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
Abstract
The invention discloses a Framework BMVVMFramework capable of quickly realizing MVVM mode. The Framework BMVVMFramework comprises entering an initialized page requiring loading network data list, a default page which is associated with the initialized page and a package page which is associated with the default page; a data display page which is associated with the initialized page and a package non-layout page which is associated with the data display page. By means of the Framework BMVVMFramework capable of quickly realizing MVVM mode of the invention, the structure of the whole project is more clear, simpler and easier to understand; the versatility is strong; a MVVM mode effect can be immediately generated without extra learning.
Description
Technical field
The present invention relates to Android development fields, more particularly to a kind of framework for quickly realizing MVVM patterns
BMVVMFramework。
Background technology
In Android exploitations, Activity is not the Controller in the MVC pattern of a standard, its head
Want responsibility to be layout and the initialising subscriber interface of loading application, and receive and process the operation requests from user, Jin Erzuo
Go out response.As the complexity of interface and its logic is constantly lifted, the responsibility of Activity classes is continuously increased, so that becoming huge
It is too fat to move.When we move to wherein complicated logical process in an other class (Presneter), Activity is in fact
View in MVP patterns, it is responsible for the initialization of UI elements, set up the associating of UI elements and Presenter (Listener it
Class), while oneself can also process some simple logics (complicated logic transfers to Presenter process).It is specific as follows:1、
Model-View-Controller patterns (abbreviation MVC pattern), View receives event, and calls Controller to operate
Model, after the data of Model examples change, Controller is updating View.2、Model-View-Presenter
Pattern (abbreviation MVP patterns), View layers become a passive thing, and Presenter is responsible for completing View layers with Model layers
Interaction.View cannot be interacted directly (allow Model and View to interact in MVC) with Model, and only Presenter informs it
Update, it just can go to update.And the interaction of Presenter and View is completed by interface.3、Model-View-
ViewModel patterns (abbreviation MVVM patterns), the event of View is directly delivered to ViewModel, and ViewModel is gone to Model
Operated and received renewal.And then feed back on View.Therefore, in sum most of Android projects are all based on MVC
Or MVP patterns are developed, MVC pattern benefit is exactly that the renewal of data becomes very simple, but shortcoming is also fairly obvious,
Activity becomes very too fat to move, and nearly all function is all integrated into a place, later stage bad maintenance.MVP patterns are used
Presenter separates feature code with Activity, but with the relation between function increase Presenter just
Become to become increasingly complex, it is difficult to distinguish.
Now, small part adopts MVVM mode developments.Response type of the third-party MVVM pattern frameworks based on Rx series
Programming framework, it is too high to there is learning cost, is not easy to grasp, and and non-usage can be to set up MVVM schema entries, also
Oneself go the defect for encapsulating and formulating standard.
The content of the invention
In view of the above problems, it is an object of the invention to provide a kind of structure for making whole project becomes apparent from, simply, hold
It is readily understood, and versatility is extremely strong, without additional studies, as long as using the project that just can at once generate a MVVM pattern
Quickly realize the framework BMVVMFramework of MVVM patterns.
For achieving the above object, a kind of framework BMVVMFramework for quickly realizing MVVM patterns that the present invention is provided,
Characterized in that, including the acquiescence page associated into the initialization page and the initialization page for needing load networks data list
Face and with the related encapsulation page of default page, with the video data page that associates of the initialization page and with the video data page
The encapsulation of association not layout page.The initialization page loads a View and points out the page, there is the state of loading data after data
Then it is changed into drop-down refreshing and loads more, and obtains data and be possible to Network Abnormal and obtain less than and after data are taken back
May parse and mistake or server crash occur, or only table data does not have content.The video data page is by number
Data association is carried out according to view is bound after return, and incidentally clicks on event, there is defined the outlet of unified request, adjusted back
Data bind view and click event automatically, return a kind of unified template, easily realize that data are bound and responded.Encapsulate not cloth
Office's page is that Flushing status and List View are associated by the two-way binding technology of Databinding, easily realizes row
Table handling is affected Flushing status and then asks network data to carry out the renewal of new round List View and controlled by the page and number of pages
Carry out loading more data;List request data and state relation, state is also accordingly changed when network request, shape
State changes the change that can be immediately associated with view.Default page be non-list need the interface of load networks data similarly with
The pattern similarity of list, although implementation is inconsistent, but equally follow unified method.
In some embodiments, initialize the page loading state null data state, Flushing status, error condition,
Network Abnormal state, and interaction readjustment and loading data.
The invention has the beneficial effects as follows:1st, the function that fast construction goes out MVVM schema entries is provided by the present invention, without
Additional studies and encapsulation function can set up a complete MVVM schema entry, improve development efficiency.2nd, with
The template of BaseViewModel is with reference to the development library for deriving a set of extremely simplicity.It is thereby achieved that making the knot of whole project
Structure becomes apparent from, simply, it is readily appreciated that, and versatility is extremely strong, without additional studies, as long as using just can at once generating one
The effect of individual MVVM patterns.
Description of the drawings
Fig. 1 is the distribution block diagram of the present invention.
Specific embodiment
Invention is described in further detail below in conjunction with the accompanying drawings.
As shown in figure 1, a kind of framework BMVVMFramework for quickly realizing MVVM patterns, including enter and need plus contained network
The initialization page of network data list and the default page that associates of the initialization page and with the related encapsulation page of default page
Face, the encapsulation associated with the video data page that associates of the initialization page and with the video data page not layout page.Initialization
The page loads View and points out the page, the state for having loading data after data be then changed into drop-down refreshing and load it is more, and
Obtain data be possible to Network Abnormal and obtain less than, and data take back after may parsing occur mistake or server collapse
Burst, or only table data does not have content.State null data state, Flushing status, the mistake shape of initialization page loading
State, Network Abnormal state, and interaction readjustment and loading data.The video data page is entered by binding view after data return
Row data association, and event is incidentally clicked on, the outlet of unified request is there is defined, callback data binds view and point automatically
Event is hit, a kind of unified template is returned, easily realizes that data are bound and responded.Layout page is not to pass through for encapsulation
The two-way binding technology of Databinding is associated Flushing status and List View, easily realizes that list operation affects brush
New state so ask network data carry out the renewal of new round List View and by the page and number of pages control carry out loading it is more
Data;List request data and state relation, state is also accordingly changed when network request, and state change can be immediately
It is associated with the change of view.Default page is that non-list needs the interface of load networks data similarly with the pattern phase of list
Seemingly, although implementation is inconsistent, unified method but is equally followed.Fast construction is provided by the present invention go out MVVM schema entries
Purpose function, without additional studies and encapsulation function a complete MVVM schema entry can be set up, and improve development efficiency.With
The template of BaseViewModel is with reference to the development library for deriving a set of extremely simplicity.
In addition, alternative scheme adopts the frameworks such as RxJava, ReactiveCocoa.May be used to build MVVM patterns, but
The frameworks such as RxJava, ReactiveCocoa are built and also need to carry out extra study, and without perfect encapsulation, need volume
It is outer to go to adjust and improve, it is impossible to reach the simple and efficient and easy to understand of the present invention, once using MVVM patterns can be generated
Project.
Above-described is only some embodiments of the present invention.For the person of ordinary skill of the art, not
On the premise of departing from the invention design, some deformations and improvement can also be made, these belong to the protection domain of invention.
Claims (2)
1. a kind of framework BMVVMFramework for quickly realizing MVVM patterns, it is characterised in that include into needing plus contained network
The initialization page of network data list and the default page that associates of the initialization page and with the related encapsulation page of default page
Face, the encapsulation associated with the video data page that associates of the initialization page and with the video data page not layout page;
The described initialization page loads a View and points out the page, the state for having loading data after data to be then changed into drop-down brush
New and loading is more, and obtain data be possible to Network Abnormal and obtain less than, and after data are taken back may parsing occur
Mistake or server crash, or only table data does not have content;
The described video data page is to carry out data association by binding view after data return, and incidentally clicks on thing
Part, there is defined the outlet of unified request, and callback data binds view and click event automatically, returns a kind of unified mould
Plate, easily realizes that data are bound and responded;
Layout page is not that Flushing status and List View are entered by the two-way binding technology of Databinding for described encapsulation
Go and associate, easily realize that list operation affects Flushing status and then asks network data to carry out the renewal of new round List View and lead to
Crossing the page and number of pages control carries out loading more data;List request data and state relation, state when network request
Also accordingly it is changed, state change can immediately be associated with the change of view;
Described default page is that non-list needs the interface of load networks data similarly with the pattern similarity of list, although
Implementation is inconsistent, but equally follows unified method.
2. a kind of framework BMVVMFramework for quickly realizing MVVM patterns according to claim 1, it is characterised in that
State null data state, Flushing status, error condition, the Network Abnormal state of described initialization page loading, and interaction
Readjustment and loading data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610961596.0A CN106569818A (en) | 2016-11-04 | 2016-11-04 | Framework BMVVMFramework capable of quickly realizing MVVM mode |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610961596.0A CN106569818A (en) | 2016-11-04 | 2016-11-04 | Framework BMVVMFramework capable of quickly realizing MVVM mode |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106569818A true CN106569818A (en) | 2017-04-19 |
Family
ID=58535577
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610961596.0A Pending CN106569818A (en) | 2016-11-04 | 2016-11-04 | Framework BMVVMFramework capable of quickly realizing MVVM mode |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106569818A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109284101A (en) * | 2017-07-20 | 2019-01-29 | 菜鸟智能物流控股有限公司 | Method and device for changing association of object attributes |
CN109446449A (en) * | 2018-10-09 | 2019-03-08 | 上海连尚网络科技有限公司 | A kind of preparatory method and apparatus for refreshing information content of pages |
CN110995565A (en) * | 2019-10-25 | 2020-04-10 | 陈奕博 | Page display method based on MVVM (multifunction vehicle virtual machine) architecture |
CN111796577A (en) * | 2020-06-29 | 2020-10-20 | 中国第一汽车股份有限公司 | Data instruction processing method and device, vehicle and storage medium |
CN112100187A (en) * | 2020-08-31 | 2020-12-18 | 湖北美和易思教育科技有限公司 | Student learning data storage method and device based on VueJS |
CN113204442A (en) * | 2021-05-31 | 2021-08-03 | 成都安恒信息技术有限公司 | Javascript library for operating IndexDB based on MVVM mode |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140282367A1 (en) * | 2013-03-13 | 2014-09-18 | Northrop Grumman Systems Corporation | System and method for automated web processing service workflow building and application creation |
CN105867919A (en) * | 2016-03-28 | 2016-08-17 | 浙江大学 | Front end data bidirectional binding realization method based on accessor hijack |
-
2016
- 2016-11-04 CN CN201610961596.0A patent/CN106569818A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140282367A1 (en) * | 2013-03-13 | 2014-09-18 | Northrop Grumman Systems Corporation | System and method for automated web processing service workflow building and application creation |
CN105867919A (en) * | 2016-03-28 | 2016-08-17 | 浙江大学 | Front end data bidirectional binding realization method based on accessor hijack |
Non-Patent Citations (2)
Title |
---|
GITHUB: ""MVVMFramework:Using DataBinding and Retrofit to build a fast MVVM framework"", 《HTTPS://GITHUB.COM/BIGKOO/ANDROID-MVVMFRAMEWORK》 * |
陈涛: ""MVVM设计模式及其应用研究"", 《计算机与数字工程》 * |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109284101A (en) * | 2017-07-20 | 2019-01-29 | 菜鸟智能物流控股有限公司 | Method and device for changing association of object attributes |
CN109446449A (en) * | 2018-10-09 | 2019-03-08 | 上海连尚网络科技有限公司 | A kind of preparatory method and apparatus for refreshing information content of pages |
CN109446449B (en) * | 2018-10-09 | 2022-05-10 | 南京尚网网络科技有限公司 | Method and equipment for refreshing information page content in advance |
CN110995565A (en) * | 2019-10-25 | 2020-04-10 | 陈奕博 | Page display method based on MVVM (multifunction vehicle virtual machine) architecture |
CN111796577A (en) * | 2020-06-29 | 2020-10-20 | 中国第一汽车股份有限公司 | Data instruction processing method and device, vehicle and storage medium |
CN112100187A (en) * | 2020-08-31 | 2020-12-18 | 湖北美和易思教育科技有限公司 | Student learning data storage method and device based on VueJS |
CN112100187B (en) * | 2020-08-31 | 2024-01-26 | 武汉美和易思数字科技有限公司 | Student learning data storage method and device based on VueJS |
CN113204442A (en) * | 2021-05-31 | 2021-08-03 | 成都安恒信息技术有限公司 | Javascript library for operating IndexDB based on MVVM mode |
CN113204442B (en) * | 2021-05-31 | 2023-11-24 | 成都安恒信息技术有限公司 | MVVM mode-based javascript library system for operating IndexdDB |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106569818A (en) | Framework BMVVMFramework capable of quickly realizing MVVM mode | |
CN103309674B (en) | A kind of software architecture system | |
CN105761007A (en) | Information management software design aiding method and information management software design aiding system | |
CN107608675A (en) | Cross-platform front end development system and method based on virtual document object model | |
CN105867944B (en) | Web front end data operation layer and its implementation | |
US9910722B2 (en) | Generic callback handling | |
CN103164206A (en) | Software customization system based on software as a service (SAAS) | |
CN103246521B (en) | A kind of SaaS based on cloud computing platform and its application method | |
CN103268230A (en) | Method used for constructing cloud computing information management platform capable of expanding service | |
WO2017109791A1 (en) | A system and method for building enterprise applications | |
CN103150154A (en) | Implementation method and device of application plug-in | |
CN106610837A (en) | Application development method and development platform | |
CN102541566A (en) | Method for generating interface frameworks of semiconductor software | |
CN109471626A (en) | Page logic structure, page generation method, page data processing method and device | |
CN103152433B (en) | A kind of use, interaction and the request processing method at Distributed Services end | |
US10455060B2 (en) | Method and apparatus for expanding transactions in OPC UA | |
CN103812953A (en) | Communication interface system of micro-control unit and ARM (advanced RISC (reduced instruction-set computer) machines) processor | |
CN103677819B (en) | The implementation method and realization device of code forward engineering based on OSGI | |
CN103902271B (en) | The unified method for showing window interfaces in client and browser | |
CN104598250B (en) | A kind of system management architecture and its method for realizing management | |
CN103870280B (en) | Webpage seamless combining processing method based on FLEX and JSP | |
CN105843601B (en) | Screen self-adaptive adapting method based on android system | |
CN108933760A (en) | Safety service control method and system | |
WO2016201813A1 (en) | Dynamic layout method and system based on android | |
US9239720B2 (en) | Device and method for generating application model based on layered structure |
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 | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20200323 Address after: 535000 5th floor, production auxiliary building, mingyueyuan, Qinzhou high tech Industrial Development Zone, Guangxi Zhuang Autonomous Region Applicant after: Guangxi Bilai Network Technology Co., Ltd Address before: 510623, 30, Zhujiang East Road, Guangzhou, Guangdong, 601 (601-B), Tianhe District, China Applicant before: GUANGDONG SUIYANG BUSINESS SERVICE STOCK Co.,Ltd. |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170419 |