mvp

MVC / MVP / MVVM What the Heck?

不羁岁月 提交于 2019-11-29 19:32:23
I recently worked on a .Net WPF project to build a retail point of sale system where I used the MVP pattern for the first time. It took me a little while to wrap my head around the change of approach but once I did that I thought that the concept rocked! My question is this: what is the distinction between MVC, MVP and MVVM? If there is a clear distinction, are there guidelines as to when you should use one pattern over another? If anyone can offer guidance on this, or point to article that explains the differences I'd very much appreciate it. Microsoft's Application Architecture Guide

What are the differences between Presenter, Presentation Model, ViewModel and Controller?

不羁岁月 提交于 2019-11-29 19:05:31
I have a pretty good idea how each of these patterns work and know about some of the minor differences between them, but are they really all that different from each other? It seems to me that the Presenter, Presentation Model, ViewModel and Controller are essentially the same concept. Why couldn't I classify all of these concepts as controllers? I feel like it might simplify the entire idea a great deal. Can anyone give a clear description of their differences? I want to clarify that I do understand how the patterns work, and have implemented most of them in one technology or another. What I

Dagger 2 with MVP, avoid creating extra presenter object on view recreation

泄露秘密 提交于 2019-11-29 16:29:15
问题 I have an app implementing the MVP pattern with a Loader to maintain the presenter object on view recreation (there's an article about this here). I'm new to Dagger 2, trying to implement it together with the current code. I've managed to make it work, but now my presenter is created twice. At first it was created using a factory class which was initialized in onCreateLoader , but then, when adding Dagger 2 implementation, I had two objects created (in factory class and when injecting). Now I

MVP pattern, how many views to a presenter?

孤街醉人 提交于 2019-11-29 14:29:19
问题 We are trying to get the Model-View-Presenter pattern used on (virtually) all new dev work that we undertake. I'm a strong believer in having a framework to help people meet a design requirement, we have a few in-house frameworks for various different components (logging, email sending, etc), so I'm trying to get some kind of MVP framework developed. I've managed to put together something that is easy to use for people who aren't familiar with MVP and that isn't too far removed from how we

Need Context in Model in MVP

帅比萌擦擦* 提交于 2019-11-29 12:36:29
问题 I need to use the Context of activity in the model while using MVP in android to get the list of all the installed application.what is the correct way to access the context or any alternative to achieve the same while following the MVP pattern. here are the classes: public class MainActivity extends BaseActivity implements MainView,View.OnClickListener { private MainPresenter mPresenter; private Button sendButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

Model-View-Presenter and Modal Dialog boxes… How to?

a 夏天 提交于 2019-11-29 09:38:07
问题 I am implementing MVP/M-V-VM in WPF and I'm having good luck with it so far. However, I don't see how this model supports implementing Modal dialog boxes. I've derived my work from Crack.NET (http://www.codeplex.com/cracknetproject) to learn how this stuff works. I have a ShellView view (which is just XAML) that has a menu on it. The menu binds to a command in the ShellModelView that says "EditPreferences". The ShellModelView implements the ICommand for EditPreferences and here we want to put

InvalidCastException for two Objects of the same type

六眼飞鱼酱① 提交于 2019-11-29 09:09:43
I have this weird problem that I cannot handle myself. A class in the model of my mvp-project designed as singleton causes an InvalidCastException. The source of error is found in this code line where the deserialised object is assigned to the instance variable of the class: engineObject = (ENGINE)xSerializer.Deserialize(str); It occurs whenever I try to add one of my UserControls to a Form or to a different UC. All of my UCs have a special presenter that access the above mentioned instance variable of the singleton class. This is what I get when trying to add a UC somewhere: 'System

Reusing Monotouch code in Monodroid app

随声附和 提交于 2019-11-29 08:19:18
问题 I'm currently implementing a Monotouch application that will eventually be ported to Monodroid. The application is just a client to an OData Web service. Nothing too fancy or performance critical. The challenge is to reuse as much code as possible. I'm aware that the UI APIs for Monotouch and Monodroid are quite different, but I'm hoping to to reuse the data data abstraction and business layers. Since my UI layer follows the MVP pattern, I also hope to reuse UI controllers by coding an

What is the actual pattern for MVC WRT WebApplications? [closed]

≯℡__Kan透↙ 提交于 2019-11-29 04:36:05
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . The confusion is because of the different MVC architechture diagrams floating on the internet: Since the question would be too broad I

Applying the MVP pattern to JDialogs

99封情书 提交于 2019-11-29 04:13:01
问题 I'm writing a Swing application, and further to my previous question, have settled on using the Model-View-Presenter pattern to separate the user interface from the business logic. When my application starts up, it executes the following code: Model model = new BasicModel(); Presenter presenter = new Presenter(model); View view = new SwingView(presenter); presenter.setView(view); presenter.init(); which creates the user interface. Events are generated by the View , and delegated to the