WPF Prism + existing WPF application

I have an existing application.

With about 3 years of experience with WPF / MVVM - I feel like I should have started with Prism (I don't know the PRISM framework at the moment - and I plan to learn it now).

Objectives - - To make the application the basis of SOLID (design). The existing code is a combination of MVVM (latest new features) and code by model (existing features)

Since this is a massive application - moving everything to Prism would be quite a challenge.

Questions: - I am planning to start a new development (large function implementation). Can I use Prism for new development? I'm happy to write most of the components from scratch and slowly get to work to move the entire application to Prism.

eg. An existing real-time real-time application planning to add office / mid-office functionality to it and slowly move the front-office functionality to Prism.

  • I have a feeling that learning PRISM can be as much a learning curve as going from winforms to WPF - is it true? any suggestions for books i should follow? I'm a bit of a procedural learner and prefer a step-by-step tutorial on the basics (i.e. All about Prism).

  • What are the huge benefits that I will get with Prism. Could there be any performance gains at the GUI level?

Best regards, Vinoy

+3


source to share


2 answers


I recommend the official guide , which by the way starts by defining Prism like this:

Prism provides guidance in the form of samples and documentation to help you easily build and build rich, flexible, and easily maintainable Windows Presentation Foundation (WPF) desktop applications. By using design patterns that embody important principles of architectural design, Prism helps you build and build applications using loosely coupled components that can evolve on their own, but that can be easily and seamlessly integrated into the overall application. In short, these applications are "built to last" and "built for change." These types of applications are known as composite applications .

I have highlighted the sentence that I think best summarizes together with the term they use to refer to such applications: composite applications.

If your application can benefit from having loosely coupled modules, then Prism might be the way to go. For example, in ERP development, you can implement each respective functional area as a module. You may want to be more granular and use modules for different parts of the user interface, for example in the trader's reference implementation .

I did not find the learning curve significantly steep. Indeed, the guide is pretty well organized and you can jump straight to the concepts you need without having to read the whole thing. Far from being the same change as moving from WinForms to WPF: it builds on the MVVM fundamentals you are familiar with, adding some higher level abstractions and using some well-known patterns like publisher / subscriber events.



The bottom line is that for a decent sized application, you should gain maintainability by investing in using Prism. Once proficient with MVVM, learning should be fairly straightforward.

EDIT : Response comment

So, can I run a PRISM based GUI suite in an existing WPF application?

Absolutely yes. You can use the bit that you find useful, and most likely use it more and more. Be aware that you may need to change your application's initialization to implement Bootstrapper . However, this is not necessary, so just take a look at the templates and start using the ones you see fit. It's not all or nothing.

+2


source


Porting an existing application to Prism is a pretty big undertaking. The participle of the app is Prism, while some of that may not be possible, but I think you will find yourself very frustrated that you have to jump back and forth between the two worlds and find ways to make them play well together.



I personally would not go this route. If you want the benefits of dependency injection, then it would be much easier to gradually adopt the dependency injection library than to adopt the much larger Prism system. Specifically, as you create new functions, write them so that their dependencies are injected ... initially this code doesn't fire, so you go to where each of these dependencies are actually defined and add a line of code to register them with DI.

0


source







All Articles