PC Review


Reply
Thread Tools Rate Thread

Design Patterns (Model View Presenter etc)

 
 
Maximilian
Guest
Posts: n/a
 
      6th May 2008
Hi

Im researching methods and design-patterns to separate UI's from logic and
model for the software Im developing at work (pretty generic UI's bound to a
datamodel etc). I have been working with dotnet for quite some time now
(~5yrs) but have never tried out any of these design patterns (MVC, MVP or
....) so its quite new to me.

If I separate the UI from the rest and make the UI know about "the rest" but
not the other way around. Is that a bad idea? To simple?

My view of the MVP-pattern is that it allows a sort of mediator (Presenter)
to maintain (get/set) the state of the View, listen to events delegated by
the view with void-no-params-metods and also do the appropriate modifications
to the model. Is that a correct view or have I missed the point?

How does these patterns exactly fit in the dotnet winform-model with
databindings etc? I can't use databindings with a MVP-pattern can I?

One other thing I'm struggling with is if I should loose winform and focus
on WPF instead. I have been looking on WPF for a couple of days but its seems
to be so much new... phew ... at the same time a want to learn ...

and then there are the (D)M-V-VM patterns for WPF ... and the MV-Poo pattern

I dont know what my question is here exactly ... guidance? enlightenment?
WinForm or WPF for ui-modularisation?, recommended design-pattern?, is there
any _simple_ example-projects for the different kinds of DP:s and the
differences between them, pros/cons over regular programming... ?
 
Reply With Quote
 
 
 
 
Maximilian
Guest
Posts: n/a
 
      6th May 2008
Following up on my own thread:

I have looked at the ContactDatabase-example by John Gossman and to me it
seems that the model-view-viewmodel-pattern is pretty much the same as MVP
except that the presenter/viewmodel doesnt handle states and doesnt receive
delegated events, but instead exposes ICommands's and exposes parts of the
model to be databound from the view. I could be completely wrong here of
course ... does this make any sense? I noticed for instance that John doesnt
use an interface, IView, in this example, but directly wraps the viewmodel in
the view, which in turn wraps the model ...

I dont know if Im wrong here but using a presenter to set/get the state of
the view (through IView) feels kind of backwards in a modern wpf app... ?
 
Reply With Quote
 
enzeez
Guest
Posts: n/a
 
      17th May 2008
Hi,

Did you download and try the guidance automation toolkit and smart
client software factory ?

regards
nz


Maximilian wrote:
> Hi
>
> Im researching methods and design-patterns to separate UI's from logic and
> model for the software Im developing at work (pretty generic UI's bound to a
> datamodel etc). I have been working with dotnet for quite some time now
> (~5yrs) but have never tried out any of these design patterns (MVC, MVP or
> ...) so its quite new to me.
>
> If I separate the UI from the rest and make the UI know about "the rest" but
> not the other way around. Is that a bad idea? To simple?
>
> My view of the MVP-pattern is that it allows a sort of mediator (Presenter)
> to maintain (get/set) the state of the View, listen to events delegated by
> the view with void-no-params-metods and also do the appropriate modifications
> to the model. Is that a correct view or have I missed the point?
>
> How does these patterns exactly fit in the dotnet winform-model with
> databindings etc? I can't use databindings with a MVP-pattern can I?
>
> One other thing I'm struggling with is if I should loose winform and focus
> on WPF instead. I have been looking on WPF for a couple of days but its seems
> to be so much new... phew ... at the same time a want to learn ...
>
> and then there are the (D)M-V-VM patterns for WPF ... and the MV-Poo pattern
>
> I dont know what my question is here exactly ... guidance? enlightenment?
> WinForm or WPF for ui-modularisation?, recommended design-pattern?, is there
> any _simple_ example-projects for the different kinds of DP:s and the
> differences between them, pros/cons over regular programming... ?


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WinForm with Dynamic Controls and Model View Presenter =?Utf-8?B?QmlsbDQ0MDc3?= Microsoft Dot NET Framework Forms 0 1st Oct 2007 08:17 PM
Model View Presenter ? Piotr Nowak Microsoft ASP .NET 1 9th Jul 2007 11:07 AM
model view presenter examples Dan Microsoft C# .NET 1 3rd Apr 2007 01:48 PM
Unit Testing Model-View-Presenter Sean Chambers Microsoft C# .NET 10 9th Oct 2006 02:31 PM
Patterns and best practise for model/view/controller separation? elvis_the_king@web.de Microsoft Dot NET Framework Forms 3 20th Sep 2005 11:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:43 PM.