CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Jeremy D. Miller -- The Shade Tree Developer

Under the hood and working with .Net, TDD, Software Design, and Agile Stuff

If you want to learn about implementing Model View Presenter in ASP.Net, read this

Billy McCafferty has published a very good introduction to the MVP in ASP.Net that dives into the mechanics of a lot of the common idioms in real life enterprise architecture.  I especially liked the example of enforcing user permissions on the view in the presenter class. 

 

I mentioned a week or so back that I will be putting together an article on the Model View Presenter pattern sometime this month because I was getting a fair number of questions about the MVP pattern.  I'm still going to do it (the more the merrier on this topic), but I'm going to largely answer a lot of the specific questions about implementation with "go ready Billy's article on CodeProject."  Besides, I don't do a lot of heavy ASP.Net work anyway.

 

 



Comments

Kim said:

I have a wish for a topic in your upcoming article on MVP.
Since Databinding is becomming a more relevant solution in .NET 2.0 with object binding etc. I would like to see some best practices for using MVP with databinding.
# July 12, 2006 3:55 AM

Dave said:

Also be nice to talk about how inheritence affects the pattern.  Do you inherit from the View or Presenter (or both).
# July 12, 2006 8:17 AM

Jeremy D. Miller said:

Kim,

I'm going to have to send you to other resources for that question.  I honestly haven't done any ASP.Net databinding in years, other than really simple DataGrid stuff.

Dave,

Can you be more specific?  Do you have something in mind?  In a WinForms app we moved to a Layer Supertype for all the Presenters, but I'm not sure why you would in ASP.Net unless there is a lot of commonality in your screens.

Jeremy
# July 12, 2006 8:54 AM

Kim said:

I don't do much ASP.NET, mostly WinForms for UI programming.
Since .NET 2.0 I have found databinding to be very useful when binding to domain objects or just about any class you have. I have followed your writings on using MVP and Fowlers' as well. In the writings I've come across data is manually set by the presenter through property setters which gives us good separation. But in my scenario I often have lists that I bind to e.g Infragistics grid. That way the presenter is bypassed when the user enters data in the grid and it gets passed into the model through the binding framework. Any pointers to other peoples' writing is also greatly appreciated.
# July 12, 2006 9:32 AM

Jiho Han said:

MSDN has an article about MVP just published.  I haven't read it yet though to say much about it.
http://msdn.microsoft.com/msdnmag/issues/06/08/DesignPatterns/default.aspx
# July 14, 2006 9:11 AM

Jeremy D. Miller said:

It's Jean-Paul Boodhoo, so it should be good.
# July 14, 2006 9:51 AM

Tim Shakarian said:

This is a decent example although I'm not a fan of the View creating the Presenter. Although it's rare, you may want to have different Presenters for one View. I like to take the arrow away from View->Presenter and use something like what the WorkItem in the Composite UI Application Block to drive the use case and determine which Views get what Presenters. Nevertheless, it's great to see the Web Application world maturing.
# July 19, 2006 2:19 PM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Jeremy D. Miller

Jeremy began his IT career writing "Shadow IT" applications to automate his engineering documentation, then wandered into software development because it looked like more fun. Jeremy previously worked as a systems architect building mission critical supply chain software for a Fortune 100 company and learned agile development practices as a .Net consultant at ThoughtWorks, one of the pioneers of agile development. Jeremy is the author of the open source StructureMap (http://structuremap.sourceforge.net) tool for Dependency Injection with .Net and the forthcoming StoryTeller (http://storyteller.tigris.org) tool for supercharged FIT testing in .Net. Jeremy's thoughts on just about everything software related can be found on his weblog "The Shade Tree Developer" at http://codebetter.com/blogs/jeremy.miller, part of the popular CodeBetter site. Jeremy is a Microsoft MVP for C#. Check out Devlicio.us!

This Blog

Syndication

News

All opinions expressed here constitute my (Jeremy D. Miller's) personal opinion, and do not necessarily represent the opinion of any other organization or person, including (but not limited to) my fellow employees, my employer, its clients or their agents.

About Me

"Best Of" Compendium

StructureMap (Dependency Injection for .Net)

StoryTeller (Supercharged Fit)

Build your own Cab

TestDriven

MVP