mvp

MVP to MVVM Android

老子叫甜甜 提交于 2019-12-01 08:31:19
One guy from here told me that MVVM is better than MVP he told me many pros and many conts, but I'd like to know if my MVP is well done or if you know any other way maybe to convert to MVVM. It's a Sign in with Google MVP. I won't put all of the code but I'll put the folders and little explanation : -Model User (Simple user pojo class) -Presenter I have an object of my IGoogleLoginView where I call the methods, but here I have the logic createGoogleClient() , signIn() , onActivityResult() , onStop() , onStart() , onDestroy() all of those methods are from my interface inside the same package

wpf mvvm confusion

試著忘記壹切 提交于 2019-12-01 05:54:31
问题 as per my understanding about mvvm is. there is a model (entity class that also implement inotify...), view (xaml code) and some class as vm (kind of controller which normally inherit icommand) to let us make events/commands to be generated on specific event... m just wondering about difference between viewmodel class and xaml's code behind class... why don't we simply consider and enhance code behind... no considerable reason is in my mind to justify this... or kindly write somethng with

Unbinding presenters necessary in GWT

大憨熊 提交于 2019-12-01 05:21:42
I'm using the MVP pattern from my GWT application following the example given here http://code.google.com/webtoolkit/doc/latest/tutorial/mvp-architecture.html I have a single MainPresenter and sub-presenter for each of the panels in the MainView. To show a new sub-presenter, I do something like this: presenter = new PresenterA(new ViewA(), ....); presenter.go(panel) // presenter clears the panel and itself to the panel When PresenterA is created, it binds itself to events in the ViewA . My question is what is the proper way to switch to a new presenter? Right now, I'm simply creating a new

MVP in Scala-Swing

一笑奈何 提交于 2019-12-01 04:43:31
问题 Does anybody know some well-written sample projects showing how to achieve MVP architecture in Scala+Swing? I found only this topics about MVP in Scala + Swing: Improving MVP in Scala Scala model-view-presenter, traits And second extra question: how you think, it's right to expose GUI widgets from view to presenter not using public getters: def getNextButton(): Reactor // this code in view will be accessed by presenter to setup clickHandler but using abstract fields in traits (as described in

Android MVP: which layer should store context variable

家住魔仙堡 提交于 2019-11-30 20:42:23
I find myself where i need to play a sound file when user clicks a button on a view. MediaPlayer requires a context to be created. What is the best way to put MediaPlayer initialization code? Should I pass a context into a presenter method and play it there? Or is it ok to just play on the view. Mohsen Mirhoseini Context is a part of Android View Layer in MVP, so Presenter must not have any idea about it and you should not pass it to presenter . You have to add a methods to your View interface and implement it inside your android view components (i.e. Activity or Fragment ) and use them to do

“Illegal characters in path.” Visual Studio WinForm Design View

我怕爱的太早我们不能终老 提交于 2019-11-30 17:43:05
I am putting together a lightweight MVP pattern for a WinForms project. Everything compiles and runs fine. However when I attempt to open the WinForm in design mode in Visual Studio I get a " Illegal characters in path " error. My WinForm is using generics and inheriting from a base Form class. Is there a problem with using generics in a WinForm? Here is the WinForm and base Form class. public partial class TapsForm : MvpForm<TapsPresenter, TapsFormModel>, ITapsView { public TapsForm() { InitializeComponent(); } public TapsForm(TapsPresenter presenter) :base(presenter) { InitializeComponent();

Simple MVP example with PHP

本秂侑毒 提交于 2019-11-30 16:01:49
问题 I know how to work with the MVC model, but I don't have an idea how to work with MVP. I read about the differences between them but don't know how to accomplish it. 回答1: The difference is twofold: view is passive and unaware of model presenter (controller) changes state of model, reads information and passes it to view public function showUsers() { // -- snip $data = $accountManager->getUserDetails($from = 10, $to = 20); $view->bind('list', $data); // -- snip } This would be a simplified

Simple MVP example with PHP

自闭症网瘾萝莉.ら 提交于 2019-11-30 15:32:35
I know how to work with the MVC model, but I don't have an idea how to work with MVP. I read about the differences between them but don't know how to accomplish it. tereško The difference is twofold: view is passive and unaware of model presenter (controller) changes state of model, reads information and passes it to view public function showUsers() { // -- snip $data = $accountManager->getUserDetails($from = 10, $to = 20); $view->bind('list', $data); // -- snip } This would be a simplified example of presenter's method. Here is an old answer, briefly explaining the differences between MVC

ASP.NET MVP Injecting Service Dependency

女生的网名这么多〃 提交于 2019-11-30 15:25:38
I have an ASP.NET page that implements my view and creates the presenter in the page constuctor. Phil Haack's post providing was used as the starting point , and I'll just the examples from the post to illustrate the question. public partial class _Default : System.Web.UI.Page, IPostEditView { PostEditController controller; public _Default() { this.controller = new PostEditController(this, new BlogDataService()); } } What is the best approach to inject the instance of the BlogDataService? The examples I have found use properties in the Page class for the dependency marked with an attribute

how Implement usercontrol in winforms mvp pattern?

倾然丶 夕夏残阳落幕 提交于 2019-11-30 15:18:12
I want to Implement MVP pattern. I have a user control that has some Textboxes and when I put it in form I call a method from usercontrol and fill textboxes. But in mvp pattern I don't know how I can access to usercontrol1.fill() . Do you have an example that could help me? Here is an example implementation of the pattern. The Presenter only knows about the interface having a show method. The Presenter calls it, but the only the form (aka View) implements how the form should be displayed. public interface IMyFormView { void Show(); } public class MyForm : IMyFormView { public MyForm() { var