views:

132

answers:

4

Note: I'm not referring to any particular framework's interpretation of MVC

If I'm designing a rich client Silverlight application for instance, that involves a relatively complex UI behavior such as dragging and dropping rows between two GridViews populated by a dynamic user-defined query, would this be an appropriate pattern to use?

Certain UI behaviors (such as dropping a row on another valid row) would also lead to business rules being applied and the model being updated accordingly. If MVC isn't a good fit for this type of application; what would be a good way to structure this?



EDIT:   Re-reading my original question, it seems a bit general; i'll break it down into a more directed question:


Is there an upper-limit on granularity of user interaction where the MVC pattern is not appropriate?

*ie. A UI that would involve a controller action having to handle something on mouse_move, mouse_button_up, etc...*

+1  A: 

The MVC framework is a good canidate when you want to seperate the UI from the buisness rules from the underlying data. This allows for a very nice modular architecture wherein you can swap out the UI or Data layer without too much hassle.

Sounds like you are already thinkning in terms of MVC therefore it should be a good fit. Have fun with it!

Craig
Thanks for the answer Craig, I just clarified my question a bit
Gurdas Nijor
+2  A: 

One of the things that you'll find very early on in Silverlight development is the power of binding and you'll find yourself wanting to abstract your logic completely away from the view. While it's similar to MVC, there's a better way to handle it in Silverlight. It is for this reason that if you're building a Silverlight application, you'd be better off looking into the MVVM Pattern. The MVVM Light Toolkit is one of my favorite implementations of this pattern. It's definitely worth checking out if you're building any Silverlight or WPF applications.

senfo
Funny enough I was actually moving toward MVVM without knowing that it was a well defined application pattern. Thanks for the heads up.
Gurdas Nijor
A: 

MVC pattern is useful if your application model fits the MVC model... it's that simple. However, if your user interface is built using the usability models of Søren Lauesen or similar, you would usually have multiple controllers for a single GUI etc. Also, if your user interface is seriously simple, MVC may be overkill. Performance requirements or programmer productivity may in some cases also make MVC less useful.

There are some apps, for which MVC is a very good model, throughout. And there are some apps, where MVC doesn't make sense at all.

Lars D
A: 

Somewhat related

RailRhoad