0

I have been trying to learn WPF using the MVVM pattern for the past couple week. While learning, I came across the Prism framework. I must say, I like the Framework so far. However, I am kind of confused of certain things. I am utilizing the Framework using the Prism using this demo. This demo shows how to create Prism app using Modules. In fact, all the examples in they videos in this series seems to utilize modules. At first glance, modules approach seems very tedious and seems to be over kill for most project... well that if I understand it correctly... being the rookie here, I am not in a position to judge.

It just seems like I have to create lots of thing to get one thing up and running. Also, it seems that I have to create and implement view interface, and View-Model interface for every view everytime.... errr. It seems like I have to spend hours just to produce a single view while the framework claims to save you time... No, I am not depreciating the work behind it I am just trying to figure out what is the right way because I feel I am missing the concept.

One thing to notice that the videos that I am learning from are very old and could be very outdated but that seems the only way to get started with the Framework. Looking at this newer video which seems to go over Prism 6 it seems that the author deals with View-Model locater which allows you to wire up the view with the view models easily using reflection. Also, he does not seems to be mentioning modules.

Questions

  1. Are modules still the way to go when using Prism? If so, why this is the recommended approach. Also, what is the real benefit of using modules?
  2. Since ViewModelLocator exists, why do I need to implement IView and IViewModel interfaces? It is possible that this is no longer required but not sure.
Junior
  • 11,602
  • 27
  • 106
  • 212

1 Answers1

1

what is the real benefit of using modules?

If you can split your application in independently developed and deployed components, prism modules are one implementation option to do that. That is, if you implement your components as IModules, prism will take care of loading and handling of your components. On the other hand, if you cannot sensibly split your application in such components, you'll have no benefit from modules.

why do I need to implement IView and IViewModel interfaces?

I never implemented either of them. Once upon a time, there was an IView interface to support the ViewModelLocator, but it has been obsolete quite a while now. As for IViewModel, I cannot see why you would want an interface for view models.

Haukinger
  • 10,420
  • 2
  • 15
  • 28