locked
Which MVVM Framework to choose? RRS feed

  • Question

  • Hi all.

    I was asked to develop an application for ATM (Automatic Teller Machine) using WPF. The main issue is that it must interact with a internal framework that controls all devices like cash dispenser, sensors, card readers, touch screen, printers, etc.

    I've researched some MVVM frameworks, but I can end up with a conclusion. There's a lot of them as in http://stackoverflow.com/questions/1409553/what-framework-for-mvvm-should-i-use but each one has its issues and are made for diferent purposes. Some of them are made and kept by one person only, with brings me some concerns about maintenance, support and evolution.

    What I need:

    1. The team is formed by begginer in WPF technology (even me)
    2. The service layer must interact with this device controller framework (which has assync methods and events)
    3. It must be easy to change the view layer if another bank asks for a similar solution. So I'd like the view layer most disconnected as possible.

    Could someone give me some hints about which framework to choose? Prism seems to be the best choice for me, but I think it's not a framework for begginers.

    Thursday, February 23, 2012 4:46 PM

Answers

  • While I, too, suggest and like MVVM Light, it may not be the best option in this specific scenario.

    Given your requirement #3, you may want to consider a VM-First approach.  In that case, my recommendation would be Caliburn Micro.  It, like MVVM Light, is a very lightweight, simple framework.  However, MVVM Light is really designed for View-First development and very designer-first, where CM is designed for VM-First development.  This typically makes it easier to change out a view dynamically, as it's a bit simpler when the View isn't the starting point of the development.


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    • Proposed as answer by Horizon_Net Thursday, February 23, 2012 6:41 PM
    • Marked as answer by Kee Poppy Tuesday, March 6, 2012 6:38 AM
    Thursday, February 23, 2012 5:41 PM
  • Prism is definitely not the easiest framework for beginners.

    I've tried out most of the notable MVVM implementations, but these days, I only really use RelayCommands, Mediator pattern and a few other basic MVVM concepts, So I normally choose MVVMLite.

    Not sure if you know of this, but a TOP TIP for the start of any project is to use NuGet to install all your favourite frameworks.

    Once NuGet is installed in Visual Studio, go to Tools, Library Package Manager, Manage NuGet Packages.

    Then in the search box, type "MVVM".

    Select MVVMLite and click install. All Done. Framework installed into the project and ready to go.

    Same for Log4Net and any other frameworks you like to use.

    You will see a few light MVVM frameworks listed in the NuGet lists, because you only need a few basic concepts to leaverage MVVM.

    It really is more of a design pattern than a framework.

    Good luck!
    Pete


    #PEJL

    • Proposed as answer by Horizon_Net Thursday, February 23, 2012 6:41 PM
    • Marked as answer by Kee Poppy Tuesday, March 6, 2012 6:38 AM
    Thursday, February 23, 2012 5:02 PM
  • Hi,

    My recommendation would be to try out MVVM Light.  I've found it to be very good.

    http://mvvmlight.codeplex.com/

    http://galasoft.ch/mvvm/

    http://jesseliberty.com/2011/01/04/wpfs-mvvm-light-toolkit-soup-to-nuts-part-i/

    Best of luck!

    Anonymous9748

    • Proposed as answer by Horizon_Net Thursday, February 23, 2012 6:41 PM
    • Marked as answer by Kee Poppy Tuesday, March 6, 2012 6:38 AM
    Thursday, February 23, 2012 4:58 PM
  • I was told that there are 2 more requirements for my project

    1. Is desireable the we can change the view layer from WPF to ASP.net platform. I don't know if a MVC pattern allow this, since they are two complete different environments.
    2. It would be nice if in the future we could parameterize the navigation through an xml or txt file. All mvvm frameworks i've seem doesnt have a controller class. Am I wrong

    Can anyone tell me if MVVM frameworks can give support for these two requirements?

    Thanks in advance.

    1. The question is loaded. To change the interface layer, you would need to change the View and ViewModel layer. The Model being your core classes and data. For example, you could separate the Service layer into a separate library project and use it in two applications - a WPF MVVM desktop application, and an ASP.net server. It's just a question of what to separate and where.

    2. MVVM is just a design pattern for separating your data from your UI, it doesn't have to define your application navigation. When your project starts to grow, and you have to navigate back and forth, recreate pages, windows over and over, you'll find the code you write "create View, create ViewModel, attach VM to V.DataContext, load/open view" - This all begins to violate the DRY principle. I much prefer to centralise all the frame navigations, dialog and window openings in a central static class, I usually call ApplicationController.

    ApplicationController.NavigateHelpPage();
    I suggest you do the same, which means you can parameterize your navigation, as requested.

    Hope that answers all your questions :)

    Regards,
    Pete


    #PEJL

    • Marked as answer by Kee Poppy Tuesday, March 6, 2012 6:38 AM
    Friday, February 24, 2012 7:30 PM

All replies

  • Hi,

    My recommendation would be to try out MVVM Light.  I've found it to be very good.

    http://mvvmlight.codeplex.com/

    http://galasoft.ch/mvvm/

    http://jesseliberty.com/2011/01/04/wpfs-mvvm-light-toolkit-soup-to-nuts-part-i/

    Best of luck!

    Anonymous9748

    • Proposed as answer by Horizon_Net Thursday, February 23, 2012 6:41 PM
    • Marked as answer by Kee Poppy Tuesday, March 6, 2012 6:38 AM
    Thursday, February 23, 2012 4:58 PM
  • Prism is definitely not the easiest framework for beginners.

    I've tried out most of the notable MVVM implementations, but these days, I only really use RelayCommands, Mediator pattern and a few other basic MVVM concepts, So I normally choose MVVMLite.

    Not sure if you know of this, but a TOP TIP for the start of any project is to use NuGet to install all your favourite frameworks.

    Once NuGet is installed in Visual Studio, go to Tools, Library Package Manager, Manage NuGet Packages.

    Then in the search box, type "MVVM".

    Select MVVMLite and click install. All Done. Framework installed into the project and ready to go.

    Same for Log4Net and any other frameworks you like to use.

    You will see a few light MVVM frameworks listed in the NuGet lists, because you only need a few basic concepts to leaverage MVVM.

    It really is more of a design pattern than a framework.

    Good luck!
    Pete


    #PEJL

    • Proposed as answer by Horizon_Net Thursday, February 23, 2012 6:41 PM
    • Marked as answer by Kee Poppy Tuesday, March 6, 2012 6:38 AM
    Thursday, February 23, 2012 5:02 PM
  • Hi,

    i suggest you to use MVVM Lite. It's Very good

    http://mvvmlight.codeplex.com/

    All the Best

    regards

    Jiya

    Thursday, February 23, 2012 5:10 PM
  • While I, too, suggest and like MVVM Light, it may not be the best option in this specific scenario.

    Given your requirement #3, you may want to consider a VM-First approach.  In that case, my recommendation would be Caliburn Micro.  It, like MVVM Light, is a very lightweight, simple framework.  However, MVVM Light is really designed for View-First development and very designer-first, where CM is designed for VM-First development.  This typically makes it easier to change out a view dynamically, as it's a bit simpler when the View isn't the starting point of the development.


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    • Proposed as answer by Horizon_Net Thursday, February 23, 2012 6:41 PM
    • Marked as answer by Kee Poppy Tuesday, March 6, 2012 6:38 AM
    Thursday, February 23, 2012 5:41 PM
  • Wow

    Never though that MSDN forum could give me such fast replies. thank you all guys, I'll see everyone's suggestions and give some feedback ASAP.


    Thursday, February 23, 2012 6:42 PM
  • I'd be inclined to go with mvvm light, it'll probably cover your mvvm needs and is a lot easier than prism.

    Mention of this api controlling the touchscreen makes me wonder.  I wouldn't expect the screen to be considered external.

    Thursday, February 23, 2012 6:43 PM
  • I'd be inclined to go with mvvm light, it'll probably cover your mvvm needs and is a lot easier than prism.

    Mention of this api controlling the touchscreen makes me wonder.  I wouldn't expect the screen to be considered external.

    Yeah, it isnt.  Touch screen is just a kind of pointing device. My mistake. Sorry!
    Thursday, February 23, 2012 6:45 PM
  • The touch screen aspect should be covered with any framework fairly equally (or none at all) - though, for future proofing, choosing an API that supports/plans to support WinRT may make some sense here, as well.  (FYI - MVVM Light and Caliburn Micro both qualify in this regard...)

    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Thursday, February 23, 2012 6:50 PM
  • Also, if you or members of your team need a good hands-on tutorial that guides you through building a working MVVM project and that uses Prism, then I highly recommend Karl Shifflett's "In-The-Box" MVVM training template that you launch from within the VS 2010 IDE.

    http://karlshifflett.wordpress.com/2010/11/07/in-the-box-ndash-mvvm-training/

    Regards,

    Anonymous9748

    Thursday, February 23, 2012 6:50 PM
  • Once NuGet is installed in Visual Studio, go to Tools, Library Package Manager, Manage NuGet Packages.


    Ok, Manage Nuget Packages never shows at Tools menu. NuGet seems a little bit 'wild'...
    Thursday, February 23, 2012 7:52 PM
  • Once NuGet is installed in Visual Studio, go to Tools, Library Package Manager, Manage NuGet Packages.


    Ok, Manage Nuget Packages never shows at Tools menu. NuGet seems a little bit 'wild'...
    Ok, got it... Sorry.
    Thursday, February 23, 2012 7:55 PM
  • I was told that there are 2 more requirements for my project

    1. Is desireable the we can change the view layer from WPF to ASP.net platform. I don't know if a MVC pattern allow this, since they are two complete different environments.
    2. It would be nice if in the future we could parameterize the navigation through an xml or txt file. All mvvm frameworks i've seem doesnt have a controller class. Am I wrong

    Can anyone tell me if MVVM frameworks can give support for these two requirements?

    Thanks in advance.

    Friday, February 24, 2012 1:13 PM
  • ifyour using mvvm then no you will have to do a re write (as far as im aware). MVVM relies heavily on WPF binding which asp.net does not have.

    Friday, February 24, 2012 1:19 PM
  • Using Cinch - http://cinch.codeplex.com/ - on my team, and a few other teams here are also using it.  We also use it along with Prism (Prism has some MVVM support but it's not a MVVM framework - we use it for its support for modularity).  I looked at a few frameworks and Cinch had some good documentation (I think 6 articles on CodeProject.com) and it's relatively simple and easily modifiable/extensible.
    Friday, February 24, 2012 1:28 PM
  • > Is desireable the we can change the view layer from WPF to ASP.net platform

    Moving from WPF to Silverlight would make sense. Our large MVVM-based project in fact uses Silverlight.  ASP.NET is a much older technology, and integrating it into an MVVM framework would likely be difficult, more expensive to implement, and I can almost guarantee would encounter unforseen issues.

    You'd need to choose either ASP.NET or MVVM ... not both. Sometimes requirements can be conflicting and need to be resolved, and this is such a case.

    Friday, February 24, 2012 1:29 PM
  • An Asp.net based atm solution?

    Someone's having a laff.

    That's not a realistic requirement, mate.

    Seriously?

    Security sandbox.

    A web page running on the device isn't going to be able to dole out any money because it can't communicate out the browser.

    With WPF you could bind a ribbon or some other navigation control to whatever sort of source you fancy, including xml.  A database would make more sense though.  In fact you could generate totally different styles per user for a navigation control if you wanted to.  So that's definitely something you could do.

    Friday, February 24, 2012 3:16 PM
  • Believe or not mate, the world isnt beautiful as we think sometimes. And yes, there are web-based ATM applications. Of course they behave as local applications, they are not connected to any webserver. Just to make the UI development easier (besides I prefer develope in windows forms then html).

    Anyway it was just an ask, not a demand. So I believe I will never port the application to web platform. 

    Friday, February 24, 2012 3:44 PM
  • I was told that there are 2 more requirements for my project

    1. Is desireable the we can change the view layer from WPF to ASP.net platform. I don't know if a MVC pattern allow this, since they are two complete different environments.
    2. It would be nice if in the future we could parameterize the navigation through an xml or txt file. All mvvm frameworks i've seem doesnt have a controller class. Am I wrong

    Can anyone tell me if MVVM frameworks can give support for these two requirements?

    Thanks in advance.

    1. The question is loaded. To change the interface layer, you would need to change the View and ViewModel layer. The Model being your core classes and data. For example, you could separate the Service layer into a separate library project and use it in two applications - a WPF MVVM desktop application, and an ASP.net server. It's just a question of what to separate and where.

    2. MVVM is just a design pattern for separating your data from your UI, it doesn't have to define your application navigation. When your project starts to grow, and you have to navigate back and forth, recreate pages, windows over and over, you'll find the code you write "create View, create ViewModel, attach VM to V.DataContext, load/open view" - This all begins to violate the DRY principle. I much prefer to centralise all the frame navigations, dialog and window openings in a central static class, I usually call ApplicationController.

    ApplicationController.NavigateHelpPage();
    I suggest you do the same, which means you can parameterize your navigation, as requested.

    Hope that answers all your questions :)

    Regards,
    Pete


    #PEJL

    • Marked as answer by Kee Poppy Tuesday, March 6, 2012 6:38 AM
    Friday, February 24, 2012 7:30 PM