7

I have just started learning .net, wpf, wcf, and mvvm, and my question is:

Is it better to implement own MVVM or use an MVVM framework like MVVM Light toolkit, Prism(it is too advanced and has unity framework(not sure how it helps in development))?

ns12345
  • 3,079
  • 5
  • 41
  • 62
  • 3
    If you've just started learning .Net, then the last thing you should be thinking about is reinventing Frameworks that have been created by some VERY experienced people. – Joel Etherton Dec 10 '10 at 16:39
  • 1
    This similar question asked by me is also having some good answers to MVVM or PRISM question - http://stackoverflow.com/questions/6251821/custom-mvvm-implementation-vs-prism – akjoshi Mar 12 '12 at 06:01

3 Answers3

7

If you really want to understand the inner workings of MVVM, then try implementing your own.

If you already understand the concepts and don't feel the need to re-invent the wheel, use a Framework. Prism is a solid choice...go for it.

Justin Niessner
  • 242,243
  • 40
  • 408
  • 536
  • thanks for the quick reply. I just tried to implement MVVM from scratch. I would say I got the concept apart from few little things (that I need to dig deeper) but MVVM as a concept I got it. But what should be my choice now? my own MVVM/Prism/Light, considering the application is not a big application. – ns12345 Dec 10 '10 at 16:37
  • 1
    @NSingla - Then unless you're trying to challenge yourself to create a MVVM Framework to compete with Prism...just use a Framework! No reason to make life harder on yourself. – Justin Niessner Dec 10 '10 at 16:38
  • great, thanks I get your point. And if I jump into Prism do I need to understand Unity/MEF before trying to implement MVVM? – ns12345 Dec 10 '10 at 16:39
  • You should have an understanding of IoC, so yes, it helps ;) – BFil Dec 11 '10 at 10:59
3

I wouldn't reinvent the wheel, evaluate the frameworks and only if those don't satisfy your requirements should you consider writing your own framework.

Lazarus
  • 41,906
  • 4
  • 43
  • 54
  • This is correct, and it doesn't just apply to MVVM. Unless you're adding value, reuse, reuse, reuse and focus on your core business logic instead of infrastructure stuff that others have already done. – jason Dec 10 '10 at 17:05
3

I'd suggest to look at this talk: Build Your Own MVVM Framework

(if you still haven't)

I decided to read some resources of various frameworks first, then I've downloaded some sample project based on Caliburn Micro to understand how the things worked

Caliburn is a great framework and provide with all you need to get started and take a deep ride into MVVM

I'd suggest you to start using it, and maybe, when you feel comfortable enough, you could try to customize it or simplify it to suits your needs/style, then, if you'll have time, you will build your own one =)

EDIT

MediaOwl is the best open source project I've found to see a good implementation of Caliburn Micro in action, be sure to check it out if you'll end up chosing this framework

akjoshi
  • 15,374
  • 13
  • 103
  • 121
BFil
  • 12,966
  • 3
  • 44
  • 48
  • Is it easier than Prism/Light to implement and work? – ns12345 Dec 10 '10 at 16:57
  • http://www.japf.fr/silverlight/mvvm/index.html this comparison tool shows that Caliburn micro is not that good option, according to this either Caliburn or Light should be the choice. Although it doesnt have Prism on the list. – ns12345 Dec 10 '10 at 17:02
  • 1
    Caliburn Micro is simple but not really a basic framework, it is powerful because it has good funcionalities, MVVM Light is pretty basic, and it helps to understand the pattern. It's true Caliburn Micro doesn't have ALL the functionalities you will ever need in MVVVM, but it's way easier to patch/extend than the full version of Caliburn. That was my impression when i included the source code of the frameworks into my project to have the control over it if i'd ever needed to modify some behaviur to better suit my needs, or to modify some convention – BFil Dec 11 '10 at 10:55