While going through university and from following the development of SO, I've heard a lot about the Model-View-Controller architectural design pattern. I inadvertently used the MVC pattern even before I knew what it was, and still use it in my everyday job. From what I've seen, it's probably the most popular pattern used today. What I ha...
In domain driven design, it appears to be a good practice to use Factories to create your domain objects in your domain layer (as opposed to using a direct constructor or IoC).
But what about using the domain object factories in a presenter layer. For instance, say that I was creating a domain object from user input obtained from the p...
I'm curious about the situation where you have a user control that you want to reuse throughout an application, but you also have a page or other control that also needs a presenter.
So say I have an upload view and control
public partial class UploadControlView : System.Web.UI.UserControl, IUploadView
but I also have a page view
...
I've implemented my own copy of the model view presenter pattern (in vein of web client software factory) so I can leverage my own DI framework instead of being tied to WCSF's ObjectBuilder which I had numerous problems with. I've come up with a few ways to do it but none of them particularly make me happy. I wanted to know if anyone els...
I'm writing a Swing application, and further to my previous question, have settled on using the Model-View-Presenter pattern to separate the user interface from the business logic.
When my application starts up, it executes the following code:
Model model = new BasicModel();
Presenter presenter = new Presenter(model);
View view = new S...
Edit : Accepted Chris Holmes response, but always ready to refactor if someone come up with a better way! Thanks!
Doing some winforms with MVP what is the best way to pass an entity to another view.
Let say I have a CustomerSearchView/Presenter, on doubleClick I want to show the CustomerEditView/Presenter. I don't want my view to know ...
I'm trying to move toward TDD, ORM, Mocking, ect. I need a good example of a line of business app that uses an ORM preferably NHibernate.
It has to be open source and use the repository pattern.
I learn best by example, I have played around with the repository pattern and unit of work pattern but not in any meaningful applications.
I'...
Please excuse my ignorance, I only started coding in Silverlight recently.
I tried implementing the command pattern in Silverlight and hit a wall.
They say commands are great, because you can write them into xaml, so you can keep your code-behind clean, also you have loose coupling between your view and your viewmodel because there is n...
Hi,
I have a MVP Gui and now I would like to define certain Actions or Commands (Modify, Save, Close, ...) for certain views.
Is there an easy way to do this? Should I provide Commands for each View?
...
One problem that I have frequently run into lately is the problem of my presenter classes growing too large. Usually, I can chop up a regular large class without skipping a beat. But the presenters sometimes are a little more difficult to pare down, without making the code harder to follow.
Especially when the page starts filling up...
We are trying to get the Model-View-Presenter pattern used on (virtually) all new dev work that we undertake.
I'm a strong believer in having a framework to help people meet a design requirement, we have a few in-house frameworks for various different components (logging, email sending, etc), so I'm trying to get some kind of MVP framew...
I'm working with the Passive View pattern. The user clicks a new account button. The view delegates responsibility to the presenter using parameterless method calls.
The problem is there are multiple account types so the user needs to pick which one they want to create. How do I resolve this?
Create a new form from the view, get the n...
Can someone please explain in a way as simple as possible what the Model View Presenter pattern is? What is the difference with Model View Controller ? Which is best or for which purpose ?
...
I have a module in a Prism application and in its initialize method I want to register a presenter instead of a view with a region, i.e. I want to do this:
PSEUDO-CODE:
regionManager.RegisterPresenterWithRegion(
"MainRegion", typeof(Presenters.EditCustomerPresenter));
instead of loading a view like this:
regionManager.RegisterV...
In my applications I always end up implementing a Model-View-Presenter pattern and usually end up scrapping my View object from the screen with a get property.
For example
Person IBasicRegistration.Person
{
get
{
if (ViewState["View.Person"] == null)
ViewState["View.Person"] = new Person();
var Person = (Person) ViewState["Vi...
I've been exploring the MVP pattern with ASP.NET but I have had trouble keeping all of the presentation logic in the presenter when using a databound control on the page.
This following scenario and classes are just for example and the real case I'm working with is more complex. Any ideas or direction would be greatly appreciated.
S...
Where is the most fitting place for security and roles authorization to fit into the model view presenter design pattern?
Would it be for all pages that implement security to implement a specific interface, say IAuthorizedView that's along the lines of
public interface IAuthorizedView : IView
{
IUser user;
void AuthorizationIn...
i.e. Is MVP still the next best choice when MVC is not an option?
I thought I'd ask this here as I'm sure there are others like me who don't have the luxury of being on a green-field project and want to refactor a webforms UI to better separation of presentation from business objects...
I'm working on a legacy application tasked with a...
I have a Presenter that takes a Service and a View Contract as parameters in its constructor:
public FooPresenter : IFooPresenter {
private IFooView view;
private readonly IFooService service;
public FooPresenter(IFooView view, IFooService service) {
this.view = view;
this.service = service;
}
}
I reso...
I want to have a save button that is only enabled when the view isdirty. How should I approach this?
My particular situation is a WinForms application using .Net 2.0. I have a service layer that the presenter calls. The service layer returns a screen bound DTO.
Is it ok to bind the view to this DTO and have the DTO implement an isDirt...