New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Prism for MVVM #304

Closed
shaggygi opened this Issue May 11, 2017 · 13 comments

Comments

Projects
None yet
8 participants
@shaggygi
Contributor

shaggygi commented May 11, 2017

It would be a nice feature to have Prism in addition to MVVM Light. It might be a good time to review since it was announced the team might be doing a rewrite for UWP. @kdawg1406

@kdawg1406

This comment has been minimized.

Show comment
Hide comment
@kdawg1406

kdawg1406 May 11, 2017

Given the announcements around UWP, Brian Lagunas and I will have to get a good number of things sorted out around navigation.

kdawg1406 commented May 11, 2017

Given the announcements around UWP, Brian Lagunas and I will have to get a good number of things sorted out around navigation.

@mrlacey mrlacey changed the title from Feature: Add Prism for MVVM to Add Prism for MVVM May 12, 2017

@mrlacey mrlacey added the framework label May 12, 2017

@mrlacey mrlacey referenced this issue May 12, 2017

Closed

Prism #317

@crutkas

This comment has been minimized.

Show comment
Hide comment
@crutkas

crutkas May 13, 2017

Member

Ok, sync'ed with Bart. We'll rally with Brain and Karl as well but the POR is the following.

  • Prism team will provide list of items that need to be done to do this right [this may zero]
  • Community can start integrating a PR for support
  • Once Prism had addressed items above, we'll do a full test, and merge in

General hopes are that prism will just role straight in with no additional work since we support two different MVVM frameworks already

Member

crutkas commented May 13, 2017

Ok, sync'ed with Bart. We'll rally with Brain and Karl as well but the POR is the following.

  • Prism team will provide list of items that need to be done to do this right [this may zero]
  • Community can start integrating a PR for support
  • Once Prism had addressed items above, we'll do a full test, and merge in

General hopes are that prism will just role straight in with no additional work since we support two different MVVM frameworks already

@kdawg1406

This comment has been minimized.

Show comment
Hide comment
@kdawg1406

kdawg1406 May 13, 2017

@crutkas Prism is not an MVVM framework. Prism is well-architected guidance for building applications. The guidance is backed up by a framework for implementing that guidance.

One of the biggest roadblocks we'll face is how UPW constructs objects. Currently, UPW creates pages when they are navigated to, then resorts to using a view model locator for view model construction. Service locator is an anti-pattern. Additionally, it can't stand up to complex enterprise application demands.

Microsoft just released a book: Enterprise Application Patterns using Xamarin.Forms. This book clearly describes using a dependency injection container for Xamarin Apps, the same way WPF and ASP.NET MVC apps have been doing for years. I started using DI in 2008.

Unfortunately, UWP does not currently support using DI for page construction.

Prism uses a dependency injection container for ALL object construction. This is a well known, universally accepted best practice for building decoupled applications that can easily be modified and maintained over time.

Unless we can get the Windows Team to modernize UWP page construction, we'll have to write a Prism Navigation and Frame (or region) components to replace the current UPW implementations.

I think it would be a great win for UWP in general, to modernize object construction, follow inversion of control principles, and allow developers to register a container with the application frame/navigation implementation for all object construction.

When Prism constructions a page, it also constructs the associated view model and all of the view model's dependencies. In complex apps, view model dependencies can be a complex graph of objects. This is one reason why using a DI container is the best practice.

Prism is so much more than an MVVM framework.

Looking forward to Skyping and discussing.

Best,

Karl

kdawg1406 commented May 13, 2017

@crutkas Prism is not an MVVM framework. Prism is well-architected guidance for building applications. The guidance is backed up by a framework for implementing that guidance.

One of the biggest roadblocks we'll face is how UPW constructs objects. Currently, UPW creates pages when they are navigated to, then resorts to using a view model locator for view model construction. Service locator is an anti-pattern. Additionally, it can't stand up to complex enterprise application demands.

Microsoft just released a book: Enterprise Application Patterns using Xamarin.Forms. This book clearly describes using a dependency injection container for Xamarin Apps, the same way WPF and ASP.NET MVC apps have been doing for years. I started using DI in 2008.

Unfortunately, UWP does not currently support using DI for page construction.

Prism uses a dependency injection container for ALL object construction. This is a well known, universally accepted best practice for building decoupled applications that can easily be modified and maintained over time.

Unless we can get the Windows Team to modernize UWP page construction, we'll have to write a Prism Navigation and Frame (or region) components to replace the current UPW implementations.

I think it would be a great win for UWP in general, to modernize object construction, follow inversion of control principles, and allow developers to register a container with the application frame/navigation implementation for all object construction.

When Prism constructions a page, it also constructs the associated view model and all of the view model's dependencies. In complex apps, view model dependencies can be a complex graph of objects. This is one reason why using a DI container is the best practice.

Prism is so much more than an MVVM framework.

Looking forward to Skyping and discussing.

Best,

Karl

@shaggygi

This comment has been minimized.

Show comment
Hide comment
@shaggygi

shaggygi May 13, 2017

Contributor

@kdawg1406 Relaying to @timheuer as he might be able to reach out to resources on what you're recommending, as well.

Contributor

shaggygi commented May 13, 2017

@kdawg1406 Relaying to @timheuer as he might be able to reach out to resources on what you're recommending, as well.

@crutkas

This comment has been minimized.

Show comment
Hide comment
@crutkas

crutkas May 13, 2017

Member

@kdawg1406 what are your item requests for the platform. I'm not seeing anything listed on https://wpdev.uservoice.com/forums/110705-universal-windows-platform that reference prism. What APIs are missing? Does .NET Standard 2.0 have said APIs in it?

Member

crutkas commented May 13, 2017

@kdawg1406 what are your item requests for the platform. I'm not seeing anything listed on https://wpdev.uservoice.com/forums/110705-universal-windows-platform that reference prism. What APIs are missing? Does .NET Standard 2.0 have said APIs in it?

@kdawg1406

This comment has been minimized.

Show comment
Hide comment
@kdawg1406

kdawg1406 May 13, 2017

@crutkas My above post here details what is we need. At the moment, the UWP teams have not prioritized the needs of enterprise developers. DI is just one piece that missing. Let's do this over a skype.

kdawg1406 commented May 13, 2017

@crutkas My above post here details what is we need. At the moment, the UWP teams have not prioritized the needs of enterprise developers. DI is just one piece that missing. Let's do this over a skype.

@bartlannoeye

This comment has been minimized.

Show comment
Hide comment
@bartlannoeye

bartlannoeye May 13, 2017

Contributor

@kdawg1406 have you actually tried using PRISM for an enterprise application in UWP? It supports DI just fine for VMs. We have a healthcare application with several modules and over 80 pages running just fine with Prism (incl deep linking).

There are a few issues with application lifecycle and .NET Native to be solved, but other than that Prism for UWP has been usable for LOB apps for over 2 years now. Doing a full rewrite "just because we can" is a waste of time in my opinion. I'm not even sure where the "full rewrite" is coming from.

You are right that the navigation is different compared to Xamarin.Forms since the system uses types to navigate instead of the page instance itself. But that is how UWP works and how Xamarin.Forms works. I have already discussed this with Brian this week and I'll look into what is possible to have a uniform interface between Prism.Windows (UWP) and Prism.Forms. But if that is too complex, it shouldn't keep us from going forward with what we have (and works) to integrate with WTS (which is for UWP). Maybe @timheuer can give us some pointers, but if this isn't in the OS yet, not much we can do to inject pages.

Contributor

bartlannoeye commented May 13, 2017

@kdawg1406 have you actually tried using PRISM for an enterprise application in UWP? It supports DI just fine for VMs. We have a healthcare application with several modules and over 80 pages running just fine with Prism (incl deep linking).

There are a few issues with application lifecycle and .NET Native to be solved, but other than that Prism for UWP has been usable for LOB apps for over 2 years now. Doing a full rewrite "just because we can" is a waste of time in my opinion. I'm not even sure where the "full rewrite" is coming from.

You are right that the navigation is different compared to Xamarin.Forms since the system uses types to navigate instead of the page instance itself. But that is how UWP works and how Xamarin.Forms works. I have already discussed this with Brian this week and I'll look into what is possible to have a uniform interface between Prism.Windows (UWP) and Prism.Forms. But if that is too complex, it shouldn't keep us from going forward with what we have (and works) to integrate with WTS (which is for UWP). Maybe @timheuer can give us some pointers, but if this isn't in the OS yet, not much we can do to inject pages.

@kdawg1406

This comment has been minimized.

Show comment
Hide comment
@kdawg1406

kdawg1406 May 13, 2017

Let's take this offline and do over Skype

kdawg1406 commented May 13, 2017

Let's take this offline and do over Skype

@mrlacey

This comment has been minimized.

Show comment
Hide comment
@mrlacey

mrlacey May 16, 2017

Collaborator

Expect that some of the integration can be done by extending some of the existing templates to also support Prism.
If need help with templates and composition config, create a project that targets MVVMLight and includes all pages and features, then change that project to use Prism. We (I) can then change that project into appropriate templates.

Collaborator

mrlacey commented May 16, 2017

Expect that some of the integration can be done by extending some of the existing templates to also support Prism.
If need help with templates and composition config, create a project that targets MVVMLight and includes all pages and features, then change that project to use Prism. We (I) can then change that project into appropriate templates.

@crutkas

This comment has been minimized.

Show comment
Hide comment
@crutkas

crutkas Jun 7, 2017

Member

adding @tomzorz as he said he was possibly interested in helping.

Member

crutkas commented Jun 7, 2017

adding @tomzorz as he said he was possibly interested in helping.

@ralarcon

This comment has been minimized.

Show comment
Hide comment
@ralarcon

ralarcon Nov 24, 2017

Contributor

We are about to make PRISM available in the nightly build but Will not ship with the 1.5 moving to next milestone.

Contributor

ralarcon commented Nov 24, 2017

We are about to make PRISM available in the nightly build but Will not ship with the 1.5 moving to next milestone.

@ralarcon ralarcon modified the milestones: 1.5, 1.6 Nov 24, 2017

@shaggygi shaggygi closed this Nov 24, 2017

@shaggygi shaggygi reopened this Nov 24, 2017

@ralarcon

This comment has been minimized.

Show comment
Hide comment
@ralarcon

ralarcon Dec 11, 2017

Contributor

Now Prism framework is merged to dev branch and will be available in the next nightly build!

Contributor

ralarcon commented Dec 11, 2017

Now Prism framework is merged to dev branch and will be available in the next nightly build!

@crutkas crutkas added the in-progress label Dec 15, 2017

@ralarcon ralarcon modified the milestones: 1.6, 1.7 Dec 21, 2017

@sibille

This comment has been minimized.

Show comment
Hide comment
@sibille

sibille Jan 26, 2018

Member

Verified in dev-nightly:
Wizard: 0.16.18025.2
Templates: 0.16.18025.2

Member

sibille commented Jan 26, 2018

Verified in dev-nightly:
Wizard: 0.16.18025.2
Templates: 0.16.18025.2

@sibille sibille closed this Jan 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment