mvp

GWT MVP with Places & Activities - Where's the Model?

好久不见. 提交于 2019-11-29 01:34:08
I'm trying to familiarize myself with the "Places & Activities" design pattern for GWT development, and so far I think it has a lot of potential. I especially like the way how once you start thinking about your application in terms of "Places", browser history virtually just lands in your lap with almost no extra effort. However, one thing just bothers me: All the articles and code examples I've seen so far gloss over one (as far as I am concerned, major) aspect: the 'M' part of the 'MVP', i.e. the Model! In normal MVP architecture, as far as I understand it, the Presenter holds a reference to

What is the difference between controller in MVC pattern and presenter in MVP pattern?

别说谁变了你拦得住时间么 提交于 2019-11-28 22:57:47
问题 What is the difference between controller in MVC pattern and presenter in MVP pattern? Can you provide links for understanding the Merits and usage scenario for both of them? 回答1: In MVP the Presenter assumes the functionality of the "middle-man" (played by the Application Controller in MVC). Additionally, the View is responsible for handling the UI events (like mouseDown, keyDown, etc), which used to be the Controller's job. Eventually, the Model becomes strictly a Domain Model. Says

MVP Communication between presenters?

微笑、不失礼 提交于 2019-11-28 22:35:01
问题 I have a question about how to handle communication between presenters when using MVP. Say I have two MVP-triads. One is a list of products (Triad A) and the other is some general information about the currently selected product (Triad B). How do I tell Presenter B that that it needs to update because the selected product has changed by A? I can of course think of ways to do this, but I was wondering if there is a general convention for how to handle this. Thanks in advance for any ideas! 回答1

Internet check, where to place when using MVP, RX and Retrofit

梦想的初衷 提交于 2019-11-28 22:25:31
问题 I have went through this and this post. So I really agree with the second post that presenter should not be aware of android specific thing. So what I am thinking is putting internet check in service layer. I am using Rx Java for making network calls, so I can either place the network check before making a service call, so this way I need to manually throw and IOException because I need to show an error page on view when network is not available, the other option is I create my own error

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

為{幸葍}努か 提交于 2019-11-28 20:40:58
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 getClickedRow(ClickEvent event); List<Integer> getSelectedRows(); Widget asWidget(); } } And in the second one

Comments on my MVP pattern for Android

北城余情 提交于 2019-11-28 19:54:27
I am planning to use MVP pattern for my new Android project. I have done some sample code and I would like to know, have I implemented it correctly? Please give comments on the code and also post your suggestions. my activity class I am extending it from my BaseView class and I am implementing an interface. this activity simply calls an webservice in a new thread and updates the value in the textview. public class CougarTestView extends BaseView implements ICougarView, OnClickListener { CougarTestPresenter _presenter; public String activityName = "CougarHome"; /** Called when the activity is

MVP and multiple User Controls

主宰稳场 提交于 2019-11-28 17:14:11
问题 I’m trying to use the MVP pattern and I’m running into a design problem. I’m developing an application that will have several UserControls. The UserControls themselves have nothing to do with one another and only represent a subset of the actual model. From what I’ve read, people tend to say you should use one Presenter per View. This seems to make sense, but if I have 30 UserControls, do I really want 30 Presenters? On the flip side, if I have 1 Presenter and 1 View that represent the entire

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

大兔子大兔子 提交于 2019-11-28 17:06:12
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 StubMemberTasks()) { } public CreateMemberPresenter(ICreateMemberView view, IMemberTasks tasks) { this.view =

How to use Shared Preferences in MVP without Dagger and not causing Presenter to be Context dependent?

可紊 提交于 2019-11-28 16:29:01
问题 I'm trying to implement MVP without Dagger (for learning purposes). But I got to the problem - I use Repository patter to get raw data either from cache (Shared Preferences) or network: Shared Prefs| |<->Repository<->Model<->Presenter<->View Network| But to put my hands on Shared Preferences I have to put somewhere line like presenter = new Presenter(getApplicationContext()); I use onRetainCustomNonConfigurationInstance / getLastCustomNonConfigurationInstance pair to keep Presenter "retained"

Critique my simple MVP Winforms app [closed]

浪子不回头ぞ 提交于 2019-11-28 16:22:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm trying to wrap my mind around the MVP pattern used in a C#/Winforms app. So I created a simple "notepad" like application to try to work out all the details. My goal is to create something that does the classic windows behaviors of open, save, new as well as reflecting the name of the saved file in the title