Mvc--mvp?

Source: Internet
Author: User

Part I: What is an MVP? What is MVC?

1. What is MVP?

M: Data layer (database, network, file storage, etc...) )

V:view and activity and fragment, and their subclasses

P: Intermediary->presenter (role: associating and interacting with the M-layer data and the UI layer)

2. What is MVC?

M: Simple model (Java Bean object)

V:view and sub-categories

C:fragment and activity and sub-categories

Part Two: Starting the MVP construction

Content One: Introduction to MVP?

• First step: see a basic case? General Code Implementation

• Step two: The MVP implementation--simple case-by-level design

· Step Three: MVP implementation, optimization, optimization, 1th step, method binding


• Fourth step: Optimization, optimization, MVP-----2nd step, abstract


• Fifth Step: MVP implementation, optimization, optimization, 3rd step->baseview Solution


• Sixth step: MVP implementation, optimization, optimization, 4th step, generic design


• Seventh Step: MVP implementation, optimization, optimization, 5th step, abstract class baseactivity-> concrete implementation


• Eighth step: MVP implementation, optimization, optimization, step 6th, abstract implementation (Basepresneter and Baseview)

Content two: MVP advanced?

• Nineth Step: Optimization of MVP, optimization, 8th step->fragment login function

• Tenth step: Optimization of MVP, optimization, 9th step->fragment Abstract


• 11th Step: MVP implementation, optimization, optimization, 10th step, for LinearLayout, button integration MVP

Requirements: Integration--Implement login function

• 12th step: MVP implementation, optimization, optimization, 11th step, abstract to a class


• 13th step: Optimization, optimization, MVP implementation, 12th step

Agent One:

Agent--for the->MVP binding and reconciliation

Analyze role Division?

Target interface: Bind and Unbind Callback interface (Mvpcallback)

Target object: Concrete implementation (ACTIVITYCALLBACKIMPL, Fragmentcallbackimpl, etc...) )->activity Implementation->mvpactivity

Analysis: Create presenter, create view, etc...

Proxy object: Proxy implementation (MVPCALLBACKPROXY)

Agent Two:

Agent---->activity for the overall agent----life cycle agent

Analyze role Division?

Target interface: activitymvpdelegate

Target object: Activitymvpdelegateimpl

Proxy object: mvpactivity (Activity)

Feature implementation:

First part: Bind and Unbind--target object (life cycle)

Second part: Implementing MVP binding and bundling-target object (mvpactivity)

Part Three: Testing

Mvc--mvp?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.