mvp

What are the differences between MVC, MVP and MVVM?

时光毁灭记忆、已成空白 提交于 2019-11-28 07:36:40
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? 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 structure. It requests information from model layer. Controller only changes the state of model layer and view

MVP and UserControls and invocation

谁都会走 提交于 2019-11-28 05:06:32
I'm having some fun trying to get my head around some MVP stuf, as it pertains to User Controls. I'm using .NET WinForms (or something close to it) and Supervising Controller pattern (well, I think I am :). The User Control is itself part of an MVP application (its the View and has an associated Presenter etc). The Presenter is always started first, and it starts the Model(s) and then View(s). The View builds its UI, part of which will be to NEW the UC, which is the View. Now the (form) Presenter needs to know about the UC Presenter, but I'm thinking that it doesn't know anything about how the

Does Presenter in Model-View-Presenter create views?

大憨熊 提交于 2019-11-28 03:29:09
How are Views created in MVP? Does the Presenter always create them (in addition to View in case of subviews)? Or is it a separate third-party component or App or something that creates them? Let's also add that I'm probably going to do this on Dojo Toolkit/ExtJS (JavaScript that is). So, I have these code lines: var v = new MyApp.view.User(); var p = new MyApp.presenter.User(); where should both lines go exactly? Does the presenter instantiate the view, or vice-versa? And what instantiates the first instance? Marijn It depends ... The main goal of MVP is to separate complex decision logic

Shared Element Transitions Between Views (not Activities or Fragments)

China☆狼群 提交于 2019-11-28 02:59:39
Let's say I'm using a view-based approach to develop an Android application like for example described in the following article: http://corner.squareup.com/2014/10/advocating-against-android-fragments.html So now I have two full screen views. One is visible and contains a grid of images. The other is hidden and is a detail view of the to-be-clicked image. Without transitions on clicking an image in the grid the grid view will be hidden and the detail view will be shown. Now what if I want to have something akin to a shared element transition between the small image in the grid view and the

InvalidCastException for two Objects of the same type

纵然是瞬间 提交于 2019-11-28 02:33:10
问题 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

How to specify generic type argument in XAML

╄→гoц情女王★ 提交于 2019-11-28 00:50:41
问题 I have a BaseView for my MVP - PRISM WPF application. Now for some reason we thought to make the _presenter as a Templated field in the BaseView. earlier i had the view xaml representation as <base:BaseView xamlns:base="clr address of the dll which had BaseView" > </base:BaseView> now since i have changed the BaseView to BaseView<TPresenter>, So how shall i write the Xaml then? 回答1: You can do it since .NET 4 Framework and XAML 2009. See Generics in XAML on MSDN For instance: <my

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

Deadly 提交于 2019-11-27 21:40:35
问题 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

In MVP where to write validations

99封情书 提交于 2019-11-27 20:02:34
In Model-View-Presenter pattern where should we write validations of user input. Domain specific rules/validations should be in the Model. You can have a model.validate() to let you know if the rules are not violated. Look at Rails model (ActiveRecord) classes for a good implementation of this concept. The View should make it difficult for the user to key in invalid input. So 'entering a string for a numeric value' class of input errors should be nipped before reaching the presenter. There may be some duplication of validations between model and view. E.g. AttributeX must range between 1-100.

Composite Guidance for WPF : MVVM vs MVP

不羁岁月 提交于 2019-11-27 19:08:38
I am confused. Maybe you can help me :) I have been following the guidance of CAG and found the MVP pattern very natural to me. Suppose I have a UI-ready Model (for example : implements INotifyPropertyChanged), I use the presenter to bind this Model to a view (presenter knows an interface of the view), keeping my Code-Behind as small as possible handling only Bindings (Model and Commands) properties (or methods) or events for controls that don't have ICommand and in this case immediately being delegated to the presenter. After a while I've discovered the MVVM pattern, and so far it eludes me.

android model view presenter/controller examples [closed]

人盡茶涼 提交于 2019-11-27 17:52:05
are there any good examples or tutorials on how best to structure an android applications anywhere? am new to java and android and i've built winforms apps using passive and supervising controller variants of model view presenter and model view controller in asp.net but not really seen any examples or code on android that use these sorts of patterns. how do people structure decent size android apps out there in the wild. are there any best practices or should i be sticking rigidly to official android documentation. superjos Try with the following two examples. I've found them useful in