mvp

MVP on Asp.Net WebForms

跟風遠走 提交于 2019-12-03 16:30:21
I'm not clear about this.... When having a gridview on the View, is the controller who has to set up the Data source, columns, etc? or I just have to expose the DataBinding stuff, fire it from the controller and let the html/codebehind on the view handle all the rendering and wiring up? To be more precise: on the view should I have private GridView _gv public _IList<Poco> Source { get {_gv.DataSource;} set {_gv.DataSource = value; _gv.DataBind();} } Or should it be (from MVP pattern - Passive View and exposing complex types through IView (Asp.Net, Web Forms) ) private GridView _datasource;

GWT Editors framework - ListEditor, removing items, MVP violation

自闭症网瘾萝莉.ら 提交于 2019-12-03 16:13:08
public class PersonListEditor extends Composite implements IsEditor<ListEditor<Person, PersonListItemWidget>> { private static PersonListEditorUiBinder uiBinder = GWT.create(PersonListEditorUiBinder.class); interface PersonListEditorUiBinder extends UiBinder<Widget, PersonListEditor> {} private class Source extends EditorSource<PersonListItemWidget> { @Override public PersonListItemWidget create(int index) { PersonListItemWidget widget = new PersonListItemWidget(); panel.insert(widget, index); return widget; } } @UiField VerticalPanel panel; private ListEditor<Person, PersonListItemWidget>

What is the legend of the arrows in these diagrams (MVC - MVP - MVVM)?

六眼飞鱼酱① 提交于 2019-12-03 13:52:40
问题 I try to understand the main differences between MVC / MVP and MVVM patterns. I found these 3 diagrams but I'm not sure to understand them. Coul you help me and explain me what is the legend of the dashed line and continuous line. MVC from Wikipedia definition MVP from Microsoft MSDN website MVVM from Microsoft MSDN website 回答1: Solid lines are direct calls. Dashed lines are only event callbacks. Main differences between MVC and MVP (Passive view) patterns: In MVC view knows about model

ASP.NET Web Forms - Model View Presenter and user controls

一笑奈何 提交于 2019-12-03 13:36:11
问题 I'm new to using the MVP pattern and I just want to make sure on the best way to call a presenter from within a user control. MyPage.aspx has a presenter MyPresenter The page contains a user control which accepts MyPage's Presenter via a property which I setup from MyPage MyUserControl.Presenter = this.Presenter I'm now trying to call Method1 within the presenter which retrieves some config and sets it on the view from the user control. Presenter.Method1(); // calls method and sets config to

Sample MVC / MVP winforms Application (Non Trivial)

主宰稳场 提交于 2019-12-03 13:31:15
问题 I'm looking for a non-trivial example of MVC/MVP implemented in Winforms (C# .NET). I searched the website but getting only trivial examples, a little more would be helpful. I'm Particularly looking at ways to implement views (view for a master-child model) and controllers/presenters. 回答1: This project covers a lot more than just the forms - it demonstrates CQRS and EventSourcing amongst others, but also uses MVP (Simple View type) for it's UI: It is designed to be a demo application and

Databinding in MVP winforms

混江龙づ霸主 提交于 2019-12-03 13:07:47
问题 I have a WinForms application implemented in MVP. My form has a TextBox and I want to databind its Text property to a property in the Model. I don't want to refer to the Model in the View. After searching in Google, I found that databinding by coupling Model and View is a bad idea. My sample initialization of Model , View and Presenter is as follows. class View : Form, IView { public View() { InitializeComponent(); new Presenter(this); } } class Presenter { public Presenter(IView) : this

Can I register MVP Presenter inside Fragment

∥☆過路亽.° 提交于 2019-12-03 12:00:46
问题 I've been following MVP design pattern provided by Google to refactor my application. I have one MainActivity and many Fragments and it seems little be messy for me to create an activity for every fragment, so I've been thinking to register presenter in fragment. What I'm seeing is that every fragment register its own presenter, but I'm not sure how much wrong it is... :) So here is my Presenter: public class FirstPresenter implements FirstContract.Presenter { private final FirstContract.View

Public Methods or subscribe to View events

淺唱寂寞╮ 提交于 2019-12-03 07:56:36
问题 I have written a MVP project where the View is a WinForm that implements my IView interface. I am in the process of reviewing the code, improving it where I can and would like to ask your thoughts regarding how the view and presenter interact. Which of the following is best practice in your opinion? Expose methods of the presenter class for the view to use. (i.e make them public). Have the presenter listen to events raised by the View class. For example, my MVP uses a service that

GWT MVP updating Activity state on Place change

丶灬走出姿态 提交于 2019-12-03 07:33:57
What is the best practise to update Activity state on Place change? Imagine you have an activity with view that displays list of categories and list of items in the category. If different category is selected then app goes to new place with category ID. I want then to only refresh items and not to create new activity that also re-reads category list. My current approach is like this: public class AppActivityMapper implements ActivityMapper { private ItemListActivity itemListActivity; ... public Activity getActivity(final Place place) { final Activity activity; if (place instanceof

Clarification :MVC,MVP,MVVM

試著忘記壹切 提交于 2019-12-03 06:23:30
问题 I am reading the difference between MVC,MVP,MVVM Source: here My doubt is ,the diagrams (MVP) (MVVM) show bidirectional arrow between Modle and Presenter,Model and ViewModel. Presenter and ViewModel obviously aware of Model.But does it mean Model is aware of Presenter and ViewModel? 回答1: Presenter and ViewModel obviously aware of Model.But does it mean Model is aware of Presenter and ViewModel? No. At least, the way I view these patterns, the Model should (ideally) be unaware of anything