model-view-presenter

Most Correct way to redirect page with Model-View-Presenter Pattern

What is the best way to call a Response.Redirect in the Model-View-Presenter pattern while adhering to correct tier separation? ...

ASP.NET Model-View-Presenter and List versus Details

In Model-View-Presenter what is the correct pattern to do a page that: a) contains a grid for browsing a list of items b) an alternate mode for editing single items maybe you are toggling between two asp:panels. Do you just make the presenter smart enough to do two types of presentations? Make 2 presenters? I'm new to this pattern ...

Model View Presenter and Composite Views

I'm trying to follow the MVP (specifically Passive-View) pattern in a java swing ui application. The basic design of the application reminds a wizard control. The screen is divided to two main parts: an active view. a static navigation bar, with navigation buttons. The user can use buttons to change the active view, but the bar is ...

GWT, MVP, and UIBinding - How to get the best of all worlds

With MVP, you normally bind the View (UI) with the Presenter in the Presenter. However with the latest version of GWT, especially with UIBinding, you can do the following in the View: @UiHandler("loginButton") void onAboutClicked(ClickEvent event) { // my login code } Which basically exchanges a lot of anonymous inner class code ...

MVP - asp.net - passing information via views - confused

Hi, I've just started to play around with MVP in asp.net. One thing I quite cant figure out is how do I pass information, i.e. an integer variable from one view(webform) to another. Let's I have a customerlistView which is mapped to a customerlist.aspx page. From it I select a customer and it's record id. Say I want to display the cust...

About presenter pattern in rails. is a better way to do it?

I have in my model: def presenter @presenter ||= ProfilePresenter.new(self) @presenter end The ProfilePresenter is a class that has methods like, get_link(), get_img_url(size), get_sex(), get_relationship_status() and other methods that have not to do with the model, not even with the controller but is used multiple times in the...

How to separate the model from the view?

I have a bunch of model objects. These objects end up being rendered as views (say forms) in a rich client app. I started to annotate the fields in the model objects (Java annotations) with things that let me render them as forms on the fly (e.g displayname, group, page, validvalues). I now realise that the view has crept into the mod...

MVP, WinForms - how to avoid bloated view, presenter and presentation model

When implementing MVP pattern in winforms I often find bloated view interfaces with too many properties, setters and getters. An easy example with be a view with 3 buttons and 7 textboxes, all having value, enabled and visible properties exposed from the view. Adding validation results for this, and you could easily end up with an interf...

How do I separate business logic and database calls from a WCF web service?

This question may have been asked before, but I'm looking for a different answer than what I've seen. Our website is in ASP.NET and we use the model-view-presenter pattern to get business logic out of the markup codebehind. Is there an accepted pattern for web services for getting business logic out of the codebehind? It seems like pu...

How do I get many property values from View to Presenter in WebFormsMvp?

Hey there, What is the best way to get a number of property values of a business object from the View to the Presenter in a WebFormsMvp page? Bearing in mind this issue with DataSources: http://bit.ly/dtQhw0 Here is what i propose: The scenario is, I have a business object called Quote which i would like to load form the database, e...

Setting a default value -- presentation logic or business logic?

Hi, I was wondering if setting a default value for a SelectList is considered to be presentation logic or business logic? For example, if a requirement is that an Employee cannot be saved without a Location, but 99% of the time the location that would be selected is a particular item -- say Atlanta. Because of this, the location Selec...

GUI Design Pattern , MVP, Tab Control

Hi, I have an application that has a window similar to the one bellow . The requirement here is that when the user clicks the Save button everything has to get saved. The "Save" and "Reset" buttons are "common" to all tabs. Hence, when the "Personal Information" tab is selected and "Save" is clicked the program should also save chang...

Implementation question of the Presenter in MVP

So..I intend to use a Model View Presenter(the "passive" mode, in which the UI is pretty dumb and sends all the events to the Presenter, and the Presenter takes care of dealing with the Model) to glue my domain's business logic and the UI. My question is how should my Presenter look like. Is this what I want? public class TicTacToeGame...

Where Should MVP Presenters Be Stored in an ASP.NET web app?

Where should presenters be stored in an ASP.NET using the MVP pattern in a web app? Should it be stored in the.. .. ViewState .. Session .. or should it be static? .. or recreated with every postback? ...

dependencies between view, presenter and interface

Hi, I'm in front of a classic circular dependencies problem but the solution I've found (create a third assembly) does not seem to be ok with my view-presenter pattern. I need to reference my presenter in my view assembly I need to reference my interface(which are in the same assembly than the presenter) in my view assembly ok so I re...

Pattern for switching between discrete modes of behaviour

Design philosophy question: Suppose I have a user control which draws a graph of the characteristics of a collection of objects. The control is placed on a form with a long-lived controller class that exposes the collection of objects to draw from. The form also contains a control which allows to switch between 'modes' or different p...

rails3 html5 jquery dynamically added nested forms, presenter pattern ?

Job has many task, task has many notes How should such a form look like ? With partials so I can enter the whole job from /jobs/new , and add new tasks from /jobs/2/tasks/new with possibility to add notes from there, and of course the possibility to add new notes from /jobs/2/tasks/5/notes/new ? Is this a good place to use the presente...

A general question on model-view-presenter (C#), should the model know the presenter?

I have a MVP (passive view) setup, and it is going quite well. I recently read Martin Fowlers description of this (http://martinfowler.com/eaaDev/PassiveScreen.html) and he writes "Another advantage that Passive View is a very explicit mechanism. There's very little reliance on Observer mechanisms or declarative mappings." In my MVP I h...

Is it okay to return presenter objects from a presenter when using the "Presenter Pattern"?

For example: class Tree has_many :apples end class Apple belongs_to :tree end class ApplePresenter presents :apple def name @apple.name.upcase end end class TreePresenter presents :tree def apples present_collection @tree.apples end end Using this, there's no need to duplicate the ApplePresenter methods a...