mvp

Android MVP pattern package structure

拈花ヽ惹草 提交于 2019-11-27 14:10:54
问题 I saw various great tutorials on MVP pattern in android, but the authors all seem to have different practice on packaging. The first tutorial I saw did the packaging by functionalities. Such as, "Login", "Join", "UI" package. The UI package has only activities, the "Login" package has the interfaces for the presenter and the concrete presenter, and this package contains a sub package "Model" that contains everything about the login model(communications with the server). The "Join" package has

In MVP is onClick responsibility of View or Presenter?

我的梦境 提交于 2019-11-27 13:38:08
问题 In the MVP pattern who is responsible to handle clicks on the UI? E.g. the non-MVP approach would be something like: counterButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { totalClicks++; counterTextView.setText("Total clicks so far: "+totalClicks); } }); Using MVP is the onClick the responsibility of the Presenter ? Or the View can handle that? Can someone please clarify this? 回答1: OnClick should call a Presenter method. You should do your business in

MVP: Should the View implement a Presenter's interface or vice versa?

为君一笑 提交于 2019-11-27 13:16:07
问题 I am doing my first steps with GWT . I have a question after reading: Large scale application development and MVP Large scale application development and MVP - Part II In the first example the Presenter defines the interface for the View . public class ContactsPresenter implements Presenter { ... public interface Display extends HasValue<List<String>> { HasClickHandlers getAddButton(); HasClickHandlers getDeleteButton(); HasClickHandlers getList(); void setData(List<String> data); int

What is your favorite GWT MVP Framework? [closed]

丶灬走出姿态 提交于 2019-11-27 13:02:47
问题 What is your favorite GWT MVP Framework, and the reason behind your choice? Mvp4g GWTP GWT 2.1 Built in gwt-mpv gwt-pectin guit Other platform (please provide link) Own solution (with boilerplate code?) None Thanks. Updated : Added suggestions 3, 4, 5 to the list. Updated 2 : Added guit to the list. 回答1: I think the best technique of MVP for GWT is to have the following classes Model View Presenter And make the view and the presenter interacts through a defined interface and have the

What to use? MVC, MVP or MVVM or…?

你。 提交于 2019-11-27 10:37:04
I will start a Java project to develop a desktop application. What to use as presentation layer pattern (MVC, MVP,MVVM or....)? ...if it is possible, with some working small example... :-) Pascal Thivent Actually, the ultimate post you're looking for is this answer this answer from Karsten Lentzsch (of JGoodies fame) in the Swing Frameworks and Best Practices Swing Frameworks and Best Practices thread. Hello, I've been writing Swing apps for several years that many people find elegant. And I teach developers in working with Swing efficiently: how to structure and assemble applications, how to

How Do You Communicate Service Layer Messages/Errors to Higher Layers Using MVP?

让人想犯罪 __ 提交于 2019-11-27 10:11:23
问题 I'm currently writing an ASP.Net app from the UI down. I'm implementing an MVP architecture because I'm sick of Winforms and wanted something that had a better separation of concerns. So with MVP, the Presenter handles events raised by the View. Here's some code that I have in place to deal with the creation of users: public class CreateMemberPresenter { private ICreateMemberView view; private IMemberTasks tasks; public CreateMemberPresenter(ICreateMemberView view) : this(view, new

What is difference between MVC, MVP & MVVM design pattern in terms of coding c#

∥☆過路亽.° 提交于 2019-11-27 09:56:46
If we search Google using the phrase "What is difference between MVC, MVP & MVVM design pattern" then we may get few URL's which discuss the difference between MVC MVP & MVVM design pattern theoretically like : MVP Use in situations where binding via a datacontext is not possible. Windows Forms is a perfect example of this. In order to separate the view from the model, a presenter is needed. Since the view cannot directly bind to the presenter, information must be passed to the view via an interface (IView). MVVM Use in situations where binding via a datacontext is possible. Why? The various

Concrete Code Example of MVP [closed]

徘徊边缘 提交于 2019-11-27 09:21:45
问题 Can someone provide a concrete (actual Java code) example of MVP in action? This would include the following 3 types of classes and how they call each other's methods to achieve the pattern and process/respond to a client-side response: Model - some kind of value object (VO) View - represents or generates the UI Presenters - business logic 回答1: MVP is my favorite design pattern to create a UI. The big difference between MVP and MVC is how to handle the view. In MVC, the Controller manipulates

Dagger2 scopes and activity lifecycle

…衆ロ難τιáo~ 提交于 2019-11-27 06:15:56
问题 I have an Android Activity that I'm using Dagger2 to inject a Presenter into. I'd like my Presenter to be capable of holding state even if a configuration change occurs. For instance, I'm going to use the Presenter to kick off a network call and if the user rotates the device while the network call is in-flight I'd like to be able to receive the response after the device finishes its rotation and not have to restart the call. I'm getting tripped up because if I scope the instance of Presenter

What are the differences between MVC, MVP and MVVM?

筅森魡賤 提交于 2019-11-27 01:58:10
问题 From what I can gather, the first two don't seem that different. Whether it's called a controller or presenter, it still seems to have the same mediation functions. MVVM seems a little different in that the controller seems to be more of a part of the framework, such as with XAML bindings. What is the "Cliff's Notes" explanation of the differences? 回答1: The difference is in way how data from model layer ends up in the view instances. in classical MVC (and also in Model2 MVC) view is active