Programming, technology, and CRM – from a Belgian programmer exiled to Missouri
  • rss
  • Home
  • Soft Gallery
    • autosvnbackup.sh
    • VBScript Snippets
  • Contact Me
  • Welcome

ASP.NET / MVP

Nicolas Galler | May 9, 2007

Trying to come up with a simple implementation of the MVP pattern. We want to minimize the fuss, minimize the deviations to standard ASP.NET, maximize testability of the presenters, minimize coupling

Scenario:

  • Main entity (pool). List view, edit view.
  • Sub entity (pool manager). List view, edit view, under the pool view.
  • They need to be edited/saved together. Same screen, same transaction.

The views will be ASP.NET user controls (ascx files):

  • Pool View
  • Pool Manager View

So, there is a hierarchy of view. A pool view contains a pool manager view. There is also a hierarchy of objects, because a pool view represents a pool, and a pool manager view a manager (or list thereof). There needs to be a parallel hierarchy of presenters, right? Or should 1 presenter be responsible for doing it all? No, this would be 2 reponsibilities upon 1 class. Too much.

So, the questions are:

  • Who creates the view?? They are created as ASCX controls.
  • Who creates and initialize the presenters?? The top one is done from the ASPX page. The inside one must be done from the presenter, because the view can’t have a reference to it. The view can return the inner view as a property – easy to implement since its a control contained on the view.
Categories
Programming
Comments rss
Comments rss
Trackback
Trackback

« Project Creation Wizard Instructions for SVN+SSH on Windows (short version) »

Leave a Reply

Click here to cancel reply.

Categories

  • Experiments (4)
  • Interesting (1)
  • MSCRM (1)
  • Programming (60)
  • Rant (3)
  • Saleslogix (34)
  • Tricks (8)
  • Uncategorized (30)

Post History

  • 2010
    • January (3)
    • March (3)
    • April (2)
    • August (2)
  • 2009
    • March (2)
    • April (1)
    • May (3)
    • June (3)
    • July (1)
    • September (3)
    • October (2)
    • December (5)
  • 2008
    • January (9)
    • February (4)
    • March (9)
    • April (1)
    • May (5)
    • June (8)
    • July (1)
    • August (2)
    • September (1)
    • November (1)
    • December (3)
  • 2007
    • January (3)
    • February (7)
    • March (1)
    • April (3)
    • May (6)
    • June (2)
    • July (1)
    • August (2)
    • September (5)
    • October (3)
    • November (5)
    • December (4)
  • 2006
    • January (2)
    • September (1)
    • November (3)
    • December (4)
  • 2005
    • April (1)

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox