This question is inspired from this closed question:
What does Prism actually offer the developer? And is it worth it?
I have already implemented my own custom MVVM implementations in enterprise applications. I am interested in knowing:
- Why should I learn PRISM (specifically PRISM, not other MVVM frameworks)?
- Benefits of PRISM over custom MVVM implementation and
- Is it worth the investment in learning PRISM?
I hope this question is not subjective and everyone please don't get into arguments :)
Why Prism MVVM?
The Model-View-ViewModel (MVVM) pattern helps you to cleanly separate the business and presentation logic of your application from its user interface (UI).
What framework for MVVM should I use?
WPF Application Framework (WAF)
What is MVVM pattern in WPF?
WPF with MVVM pattern have separated all the logic and operation on ViewModel and reduced the backend coding and UI event handling. Data binding infrastructure, data temple and resource system are the most important factors of WPF that made it a great partner for MVVM pattern and make this pattern so usable.
What is Prism framework in WPF?
Prism is a framework for building loosely coupled, maintainable, and testable XAML applications in WPF, and Xamarin Forms. Separate releases are available for each platform and those will be developed on independent timelines.
As with many frameworks that do a common task for you, you get:
- Tested by many more eyeballs: than just yourself. This (hopefully) includes unit tests, which you may or may not be doing while building your own framework.
- More readable for other developers: nobody else has experience with your custom MVVM framework. But if another developer joins your project, or joins your team, or joins your company, they can jump straight into Prism code.
- Better documentation: Along the same lines, anyone new joining likely has to learn the ropes by manually gathering the collective knowledge from your brain, and any other users on the team, and by looking at the source code. Third party frameworks have their own documentation, and tons more blog posts on the internet.
- Better community: You can ask questions on StackOverflow about "how do I do X with Prism?" You can't ask that with your custom framework.
- Likely more capable: by needing to serve more users than just you/your team, more features will have been added. If you need to do something MVVM-related that you've never done before, chances are support for it isn't built in to your own MVVM framework. But it's likely in Prism.
- Better structure: Let's say you wanted to do something MVVM-related but it wasn't in Prism. Very likely, there's a good reason for that! If something's not in a (reasonably-mature) framework made for working in a given domain, that's a sign that what you're trying to do is an unnatural or awkward way of approaching the problem. Working with your own framework, it's too easy to say "oh I'll add that feature," then 6 months later realize you made a huge mistake because this new feature makes your code very hard to follow or ends up being a vector for lots of bugs or whatnot.
- A CV line-item: I would have mixed feelings toward hiring someone who had "implemented and used custom MVVM framework." While it could mean they're smart, it could also indicate the dreaded "not built here syndrome." On the other hand, putting "Microsoft Prism MVVM Framework" among a huge list of technologies could be nice, but isn't a wow-er. The best of both worlds would be a longer bullet point, along the lines of "Deep understanding of the MVVM pattern, achieved by first implementing a toy MVVM framework for learning purposes before switching to MVVM Prism." Yes, the difference between these three isn't going to make or break your CV, and not-built-here syndrome is something that would hopefully come up in an interview, but it's just worth keeping in mind, especially if you're applying for a place that gets enough resumes they can afford to throw out anything that unnerves them slightly.