Stuff coming up at the Shade Tree Developer

If you’re in Austin, I’m doing a presentation on StructureMap at the ADNUG meeting on July 10th.  I’ll post the slide deck and the coding samples afterwards.


Mea culpa, I’ve gotten really far behind in answering emails the last couple of months.  A majority of the non-StructureMap questions I get are related to the Model View Presenter pattern, usually in ASP.Net.  To catch up I’ve started to pull together a longish post on the MVP pattern that’ll be ready within a couple weeks.  Just as a start I’m going to talk about:



  • I’m going to try another stab at explaining the MVP pattern
  • Where should user input validation go?
  • Do you (always) need a service layer?
  • View visibility to the model
  • Putting the “M” in MVP
  • View/Presenter interaction
  • Dealing with security and user preferences
  • Is it time to give the Front Controller pattern very serious consideration?

There’s a bit of a paucity of information on the MVP pattern, so I’ll try to fill the gap a bit.  If there’s an MVP related topic you’d like to see addressed, put a comment on this post and I’ll see what I can do.


In the mean time, here’s some resources for MVP related stuff:


  • The Humble Dialog Box by Michael Feathers
  • Model View Presenter from a forthcoming book by Martin Fowler.  This’ll be on my bookshelf the day it comes out.
  • Mike Mason on MVP with ASP.Net 2.0
  • Test Driven Development with ASP.Net and the Model View Presenter Pattern (Me)
  • More Thoughts on Model View Presenter (Me)
  • A Simple Example of the “Humble Dialog Box” (Me)

    In no particular order, I’ve got a couple longish posts outlined or envisioned:



    • Jeremy’s Fourth Law of TDD — Avoid the Long Tail
    • The Composite and Visitor patterns
    • Iterator, Memento, and Observer patterns
    • A couple of little mock object posts I’ve put off for a long time
    • Cleaning up Legacy Code
    • Pretending Javascript is a real language — TDD with JSUnit, OOP with Javascript using Prototype, Rubyesque “Mixins” with Javascript
    • Creating a Testing DSL with the FitNesse DoFixture
    • Driving Selenium from FitNesse

    Way, way, way out is a comparison of Ruby on Rails against ASP.Net for software lifecycle issues


     

  • About Jeremy Miller

    Jeremy is the Chief Software Architect at Dovetail Software, the coolest ISV in Austin. 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 is the author of the open source StructureMap tool for Dependency Injection with .Net, StoryTeller for supercharged acceptance testing in .Net, and one of the principal developers behind FubuMVC. Jeremy's thoughts on all things software can be found at The Shade Tree Developer at http://codebetter.com/jeremymiller.
    This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
    • http://www.dotnetgeeks.com/blogs/dotnetgeek Rich Denis

      Cool. Ill try to make it by on Monday and maybe we can chat a bit.

    • jmiller

      Got it Rich, I’ll take a look

    • http://www.dotnetgeeks.com/blogs/dotnetgeek Rich Denis

      Sorry Jeremy. Relaized I left the wrong link for PAC. Here is that link:
      http://www.dossier-andreas.net/software_architecture/pac.html

    • http://www.dotnetgeeks.com/blogs/dotnetgeek Rich Denis

      Jeremy,
      Thanks for providing information on MVP. We have been using a pattern that is VERY similar called Presentation Absctraction Control. You can find out more about it here:http://www.martinfowler.com/eaaDev/ModelViewPresenter.html. I would be interested to hear what you think about this pattern as it compares to MVP. The biggest difference that I see is that the MVP layers are built into a hierarch so that the P in MVP does not get too big. If you get time let me know what you think here or at rich at dotnetgeeks . com

    • jmiller

      Nick,

      I’d love to hear how you get Selenium running inside CC.Net builds. I’m working towards just having FitNesse wrappers around the .Net API to Selenium RC so we can use our existing FitNesse/CC.Net integration. I’ll have an update on that one late next week — assuming I *can* get it to work.

    • jmiller

      Steven,

      I’m not sure that MVP is the answer for localization. I’d say that localization is strictly the purview of the view. The one and only app I’ve done that was localized (cue the “Blame Canada, Blame Canada!” song from South Park) we just made subclasses of the basic ASP.Net controls that took a localization “key” property and handled the resx fetching. I’d much rather handle that declaratively than try to do it imperatively with code in the Presenter.

      Now, if you get into the more extreme localization with different screen layouts or turning pieces of the screen on and off, that’s a different story.

    • http://www.stevenrockarts.com/blog Steven R

      I would like you to show how to deal with localization using MVP and a resx file.

    • http://www.developernotes.com Nick Parker

      Jeremy,

      I’m looking forward to seeing how you have integrated Selenium with Fitnesse, we are currently working on integrating Selenium with our CruiseControl build and it seems as if this is a rather new area.

    • Sachin Rao

      I mean, you need access to the cell to get to the hyperlink.

    • Sachin Rao

      Here’s an example for an ItemDataBound event. One of the fields in a datagrid is a hyperlink which is enabled/disabled depending on a status field

      i.e.,

      if (object.status==status.funded)
      link.enabled=true
      else
      link.enabled=false
      link.CssClass=”simpleText”

      You can make this as complex as you want, but I’m sure you get the picture. You need access to the particular DataItem in this case (to get to the hyperlink) and of course, the Presenter needs to be UI agnostic.

    • Ric

      Hey Jeremy,

      I agree with Sachin – it would be great to see a more complex example – but there are two things I’m particularly interested in (both of which we use a lot in our totally non-TDD web apps).

      The first is how you deal with situations where a page includes a complex UserControl that might include, say, a GridView and some TextBoxes. I suppose the UserControl could have a presenter of its own, but that makes interaction with the page difficult. Do the properties of the UserControl need to be re-exposed in each biew they’re used in?

      The second situation is where the ItemDataBound or ItemCreated events are used on data bound controls, such as Repeaters, to handle situations where some slightly more complex code is required than that which you might like to put in the in-line databinding tags (< %# %>). I suspect your answer in this case might be that such logic should be somewhere but the front end, but I’m sure there must be some situation where the presenter might need access to the individual items of a data bound control.

      Cheers,

      Ric

    • http://www.jpboodhoo.com/blog Jean-Paul S. Boodhoo

      Hey Jeremy,

      I think that it is awesome that there is so much buzz around people wanting to get to grips with the MVP pattern (among others). The screencast links that Jeff mentioned above are actually links to a show I did on DNRTv a while back. The shows were met with a split response!! To that end I have started the first of what will end up being a series of screencasts that I am posing on my blog at http://www.jpboodhoo.com. I am calling the series Applied Test Driven Development for Web Applications.

      I will be attempting to demonstrate the development of an application that covers all of the topics that you happened to mention in your post.

      The emphasis of the screencast will serve as a means for people to see effective uses of TDD/BDD to drive out the functionality of an application. To that end the screencasts are being done on the fly so that people can start to see TDD in action. The code is also being made available after each screencast so that people can follow along if they wish.

      I think that it is great that you are taking the time to make this information available to people. If you are looking for people to aid you in this venture I would be happy to assist as I feel that we will have complementing/overlapping material that we could share with the public.

    • Sachin Rao

      Jeremy,

      For MVP examples, could you please a more complex scenario (anything using composite server controls). I only seem to find the two-textboxes-and-a-button example for MVP.

      Cheers
      Sachin

    • jmiller

      Thanks for the links Jeff.

    • Sachin Rao

      Fantastic!!! Cant wait.

    • http://www.jeffperrin.com/ Jeff Perrin

      By far the best demonstrations of MVP (which is not in your list above) are Jean-Paul Boodhoo’s screencasts. His blog is a must read as well:

      MVP screencast – http://www.dnrtv.com/default.aspx?showID=14
      TDD part 1 – http://www.dnrtv.com/default.aspx?showID=10
      TDD part 2 – http://www.dnrtv.com/default.aspx?showID=11
      Blog – http://www.jpboodhoo.com/blog/