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
1
vote
1 answer

Should I use a presenter or a decorator?

I'm kinda lost with these terms since I'm a beginner in the Rails world. I have some code in my header, not related to the model. I just want to show it or not depending on the page user is. I know it's kinda simple and helpers would do it pretty…
Edi Junior
  • 49
  • 5
1
vote
1 answer

How can I use Repository

I use Dagger2 and Moxy with MVP. As I understand, Presenter can call the Repository for loading and unloading data from the database. But I just can not figure out how to create an instance of the repository: in the Activity with the help of Dagger…
OhHiMark
  • 55
  • 1
  • 5
1
vote
1 answer

Mocking all Rails routes in a view_context

The Rails controller and views provide a view_context (usually an ActionView::Base object) that provides context for generating the views. A common pattern is to wrap model instances in a Presenter class, in which case the view_context is usually…
user2490003
  • 10,706
  • 17
  • 79
  • 155
1
vote
1 answer

How to handle different interface implementations using MVP pattern?

I have a design that I am working on and wanted to be clear on how one should handle multiple implementations of an interface using MVP pattern. Here is my situation: There is a base "Tank" interface which defines basic functionality of what a tank…
Hooplator15
  • 1,540
  • 7
  • 31
  • 58
1
vote
0 answers

In MVP should presenters and views be in the same assembly or should they be in their own project in a Visual Studio Solution

I've been working on an MVP WinForms app where the Views and Presenters are in the same Visual Studio Project (assembly). I was thinking of separating the two into their own assemblies so the View would have fewer references to what the Presenter is…
Robertcode
  • 911
  • 1
  • 13
  • 26
1
vote
1 answer

Do we need different Presenter for Login as well as Signup Activity in android MVP pattern?

I am implementing MVP design architecture in my android application. I am new to design patterns and haven't use any in my previous project. I want to know that whether we need different presenters for different activities such as let's say, Login…
Nicolus Jovi
  • 57
  • 1
  • 9
1
vote
2 answers

Android MVP: defining Presenter in Fragments

I have done lot of search on Google and also on Stackoverflow but still I'm confused, so asking a question here. I have this small MVP design pattern - SigninView.java public interface SigninView{ void onSuccess(); void onError(); …
Gissipi_453
  • 1,250
  • 1
  • 25
  • 61
1
vote
1 answer

Show specific presenter instance to flex panel gwt mvp

I'm still learning GWT, yet already have to face some kind of challenge for a work I have to do. Can't show any specific code so I'll try to explain it well. Here's the situation: A certain class "Navigator" creates and save the Presenter instances…
1
vote
1 answer

Presenter in MVP(Android) gets deleted/gets null inside Fragment

I am using MVP. My activity contains one Fragment. I am initializing and then setting presenter to fragment inside Main-Activity's on Create method as follow. public class MainActivity extends AppCompatActivity { private StashPresenter…
1
vote
0 answers

Android MVP retain presenter on orientation change

I am implementing MVP for Login module in one of my project with the help of MVP sample from Google Sample. In my login module I am verifying user credentials by calling web service . On orientation change activity is getting recreated and hence…
Prabhu M
  • 3,534
  • 8
  • 48
  • 87
1
vote
2 answers

Using Strings from resource "R.String" on layer presenter MVP

On MVP pattern, i have string with dynamic value % Example: %s hello and i need set this text with "my name" on my textview, how i will do this witout reference direct a R.String on my presenter layer. public void…
rcorbellini
  • 1,307
  • 1
  • 21
  • 42
1
vote
1 answer

the fragment can have presenter in MVP?

I am starting the studying about MVP in one project android and I found one question interesting, the fragment can have one own presenter?
Enieber
  • 87
  • 6
1
vote
1 answer

button_to block in presenter

I'm using button_to inside the presenter. This works fine. However if I create a block I receive the error undefined method `stringify_keys' I'm wondering if it's even possible to use a button_to block outside of a view file. # Inside my presenter…
thank_you
  • 11,001
  • 19
  • 101
  • 185
1
vote
1 answer

Android TV ImageViewCard Layout margin change

I have been working on an android tv app.I have list of movies which i populated inside the BrowserFragment class.I have a presenter class that make use of ImageCardView to show the movie thumbnail.I am trying to customize the imagecardview on…
Infimate
  • 43
  • 1
  • 7
1
vote
1 answer

Remove rails presenter object assignment from view

I am using a namespaced Presenter object to help refactor some view presentation logic for my model attributes. For one object being sent from the controller I would do @user = Users::UserPresenter.new(@user) and that works fine. For a query of…
MicFin
  • 2,431
  • 4
  • 32
  • 59