mvp

Refactoring Form.ShowDialog() code to MVP

烂漫一生 提交于 2019-12-03 00:36:58
I have a WinForm and few properties that are set on it. for example : Name,Address are accepted on the Form. (many more properties in actual example) The current implementation is somewhat similar to frmName frmView = new frmName (); //frmName is WINFORM frmView.Name= "ABC"; //any valid string or read this from file frmView.Address="SomeAddress"; //any valid address or read this from file if (frmView.ShowDialog() == DialogResult.OK) { //OK CLICK PROCESS and // get new values edited by user string name = frmView .Name; string address = frmView.Address; doProcessing(name,address); } else{ /

Discuss on MVC implementation on iPhone

谁都会走 提交于 2019-12-03 00:20:30
Im a using the MVC pattern for a while on different frameworks such as (swing, android, gwt ...) Now, I'm learning the iPhone framework and I am quite surprised about MVC implementation. The questions I am asking are about the view and controller interaction. First of all, that's the way I conceive the MVC pattern : The view and the controller communicate each other through an interface (one for the view and an other one for the controller) In my conception of the MVC pattern, the controller do not have to know the attribute of the view. (for instance, the controller can't have a label

What's the best way to check for permissions at runtime using MVP architecture?

南楼画角 提交于 2019-12-02 20:38:52
I'm developing an android app in which I have to ask for permissions at runtime. I'm wondering about the best way to implement that using Model-View-Presenter architecture. My initial thought was to have the presenter call a component responsible for permissions(say a PermissionHandler ), and update view accordingly. The issue is that the code to check for permissions is tightly coupled with the Activity class. Here are some of the methods involved that require an Activity or Context: ContextCompat.checkSelfPermission() ActivityCompat.shouldShowRequestPermissionRationale() ActivityCompat

Best practice for package structure in an MVP project

懵懂的女人 提交于 2019-12-02 18:53:51
I have an Android Studio project that is using an MVP architecture. What is the advised packages structure for a project this style we can do: app: screen_name activityA presenterA interfaceA or: activities activityA activityB preentors presentorA presentorB etc Your problem is just only UI part of MVP architecture pattern . Which is View classes along with their corresponding Presenters . And the better solution is the first approach. App should have package according to features , NOT by the common functionality. We should group together the classes which are getting changed/modify together

Is this right to inject the container/kernel to the main application presenter? [duplicate]

风格不统一 提交于 2019-12-02 18:01:35
问题 This question already has answers here : Is it better to create a singleton to access unity container or pass it through the application? [closed] (4 answers) Closed 5 years ago . I'm using Ninject to handle my dependencies. My ApplicationPresenter is responsible to dispatch the user calls to features throughout the application, hence the need to inject multiple factories at once, thus the container itself. It handles an MDI GUI. Is there a better approach? Is it okay to make it so?

GWT MVP architecture advantages

扶醉桌前 提交于 2019-12-02 17:21:15
I am learning GWT and i have read at multiple places that using MVP architecture is best suitable to develop a GWT Application I have also read that its easy to do testing using the MVP ARCH.Can somebody explain me why its easy to do testing using the MVP architecture. Also i am working on a project using MVP and i find it very tedious to make the view connect to the data base.I mean i have to update my presenter,service,serviceAsync,servicImpl,Facades in order to make connection to database. So can somebody provide me the essence of MVP for GWT?i would appreciate a couple of examples.

MVP dependency injection

☆樱花仙子☆ 提交于 2019-12-02 16:00:29
using MVP, what is the normal order of construction and dependency injection. normally you create a presenter for each view and pass the view into the presenter on constructor. But what if you have: A Service that multiple views need to listen to events on. Multiple views all pointing to the same data model cache. can someone display a normal flow of info from a user click to data coming back in a service from a server. Here is what I do: First, I define theses interfaces: public interface IView<TPresenter> { TPresenter Presenter { get; set; } } public interface IPresenter<TView, TPresenter>

MVP Framework for winforms

独自空忆成欢 提交于 2019-12-02 14:12:49
i'm working in a new project and i want to implement MVP pattern. There is a framework for winforms that use this pattern? I checked CAB but my project isn't complex to implement it, i search for something more simple to implement and use. Thanks! If you are looking for something simple... then you really don't need a framework . You can roll your own MVP pattern. Writing the base classes takes only a few minutes. //Base Presenter Class public class Presenter<TView> where TView : class, IView { public TView View { get; private set; } public Presenter(TView view) { if (view == null) throw new

Is this right to inject the container/kernel to the main application presenter? [duplicate]

旧巷老猫 提交于 2019-12-02 12:28:13
This question already has an answer here: Is it better to create a singleton to access unity container or pass it through the application? [closed] 4 answers I'm using Ninject to handle my dependencies. My ApplicationPresenter is responsible to dispatch the user calls to features throughout the application, hence the need to inject multiple factories at once, thus the container itself. It handles an MDI GUI. Is there a better approach? Is it okay to make it so? ApplicationPresenter public class ApplicationPresenter : Presenter<IApplicationView> , IApplicationPresenter { public

Scala model-view-presenter, traits

只谈情不闲聊 提交于 2019-12-02 04:02:24
I am a fan of Martin Fowler's (deprecated) model-view-presenter pattern. I am writing a Scala view class containing several button classes. I would like to include methods to set the action properties of the buttons, to be called by the presenter. A typical code fragment looks like this: private val aButton = new JButton def setAButtonAction(action: Action): Unit = { aButton.setAction(action) } This code is repeated for each button. If Java/Scala had the C preprocessor, I would create a macro to generate this code, given the button name (no lectures on the evils of the C preprocessor, please).