views:

810

answers:

4

Why should I choose to use one instead of the other and in which cases?

I mainly focus on desktop applications and personally speaking I do find the humble dialog box more easy and natural to use.

+5  A: 

In MVC, you would still use your "humble" dialog. Except all the business logic for it would be farmed off to another class somewhere else.

http://en.wikipedia.org/wiki/Model-view-controller

You need to weight up whether the investment in MVC will be worth it - especially if you're only working with a single simple dialog.

Mark Ingram
+5  A: 

One of the best discussions I've found regarding the advantages and disadvantages of the model view controller/presenter patterns was written by Martin Fowler: http://martinfowler.com/eaaDev/uiArchs.html

In short, by choosing to use a MVC variant you are increasing the testability of your view (dialog). Keeping all of your logic in your dialog class on the other hand, can be fine if you do not expect that dialog to be very complex, however as the complexity increases, the benefit of testable code increases.

It really is a judgement call.

Jim Burger
A: 

There is no simple answer.

You should use whatever will make your life easier.

If dialog is really simple, and you know for sure it is going to stay that way, go with humble dialog.

If you have something more complex, like multiple view presentations of the same data, or you know your simple dialog will become more complex over time, then, by all means, use MVC.

You can also take a look ant MVP pattern as an alternative to MVC.

Dev er dev
+3  A: 

"Humble" dialogs themselves are already MVC. You have:

  • M, The content of the dialog's message.
  • V, The window and widgets the user can see.
  • C, How the dialog is displayed and how it responds to user activity.

Your GUI framework or wrapper library can provide MVC for you seamlessly without you having to think about it, but it's still MVC.

Ali A