Questions tagged [presenter]

In MVP pattern the presenter acts upon the model and the view. It retrieves data from repositories (the model), and formats it for display in the view.

143 questions
4
votes
1 answer

C# Where to put view specific information?

I'm trying to reduce the code duplication that exists throughout my asp.net web forms. This is what an example object loaded from the database looks like. Apartment int id decimal rent bool callForPricing int squareFeet int beds int…
wdrone
  • 87
  • 1
  • 6
4
votes
2 answers

How to use Capybara Rspec Matchers to test a presenter?

I'm trying to test a presenter method using a Capybara RSpec matcher. Lets say I have a method that renders a button. This would be the test I would write if I wasn't using capybara rspec matchers: it "should generate a button" do …
e3matheus
  • 2,112
  • 1
  • 20
  • 28
3
votes
2 answers

uninitialized constant for HomePresenter

I'm trying to implement a HomePresenter to be used inside the home action of my Pages controller: # app/controllers/pages_controller.rb class PagesController < ApplicationController def home @presenter =…
rickyrickyrice
  • 577
  • 3
  • 14
3
votes
1 answer

Using a presenter with Inherited Resources

I use the excellent Inherited Resources gem quite a bit in my Rails apps, but whenever I want to use a presenter I fall back to writing controllers by hand. Is there a good, clean solution for combining Inherited Resources with something like Draper…
Brian Rose
  • 1,725
  • 13
  • 10
3
votes
1 answer

Can Ninject inject a class and make it reference the target class as a back reference?

I want to inject a presenter into my webform class. While doing so I would like the injected presenter to contain a reference to the view it is being injected into. Inject a class with a reference to the class it is injected into. Is it possible to…
3
votes
3 answers

In a unit test perspective: should the view specify presenter or the other way around in GWT MVP?

In tutorials on GWT Google uses to different approaches to do MVP, either the View specifies the Presenter or the Presenter specifies the View. The first one is used when using Activities and Places. This post touches on this subject: MVP: Should…
per_jansson
  • 2,103
  • 4
  • 29
  • 46
3
votes
1 answer

Multiple MVP presenters: How to communicate and share information?

I am designing a Winforms MDI application following MVP pattern, and I'm stuck on some problems related to communication between different part of my application. Here a simple picture of this application: 1 -On the left a treeview 2- In the middle…
flamandier
  • 502
  • 4
  • 6
3
votes
1 answer

MVP in Android app - Presenter state

I work with map in Android. So, I want to save state of some of my presenters to save data, when I leaved activity(not when rotate the screen). I can't find the solution besides singleton with ArrayList, but I would like to use already written…
3
votes
1 answer

should presenters(mvP) be injected(dagger2) to views in android?

In the context of developing and android app, should I use presenters directly in views using 'new' or would it be better if I injected them to the view. Pros/cons for not using injected presenters: Faster development time, without having to write…
coditor
  • 43
  • 4
3
votes
1 answer

DDD / Presenter pattern VS Use case optimal query

In this great book about Domain-Driven Design, a chapter is dedicated to the user interface and its relationship to domain objects. One point that confuses me is the comparison between Use case optimal queries and presenters. The excerpt dealing…
Mik378
  • 21,881
  • 15
  • 82
  • 180
3
votes
2 answers

Using ActionView::TestCase::Behavior and the view method in a presenter spec

Using the Railscast example, I have written a spec for my presenter which includes ActionView::TestCase::Behavior and passes in the view method to the presenter. spec/spec_helper.rb: ... config.include ActionView::TestCase::Behavior,…
Shevaun
  • 1,208
  • 12
  • 19
3
votes
0 answers

Model View Presenter - Passive View - Who loads the Model?

I'm curious in using the MVP Pattern to improve testability. I have experience with MVC but MVP seems different. I'm having an application that operates on a 'project' file which is in fact an compressed archive of several files and folders. This…
thertweck
  • 1,120
  • 8
  • 24
2
votes
2 answers

Model View Presenter - how to implement complex Properties in an IView interace

I am finding it difficult understanding how best to implement 'IView' interface properties which are not simple types, and was wondering how others approach this in a Model View Presenter application. The articles i've read are really good but none…
sin cara
  • 123
  • 6
2
votes
2 answers

Benefits of Presenter pattern for controller testing

I'm participating in a project, which extersively uses Presenter pattern. I don't see a benefits of it, because all the methods of Presenter class are trivial, like this: class Checkout::NewPresenter def initialize(customer, order) @customer,…
AntonAL
  • 16,692
  • 21
  • 80
  • 114
2
votes
1 answer

GWT & MVP - Best practices for displaying/editing complex objects?

All the GWT / MVP examples I've learned about seem too simplistic to give a clear view what best practises are regarding displaying and handling slightly more complex model objects. For example, most examples are something like a presenter that…
user644656
  • 21
  • 2
1
2
3
9 10