×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    41

    MVVM or Not to create great Apps

    Good day all, Hope this post is not too frowned upon here but am in need of some advice. Am pretty new to Windows Phone development and the .Net Framework in general so its been a steep learning curve for me. I am in the process of creating an app (While i learn Windows phone). I recently came across MVVM Light for using the MVVM pattern during the course of my project and it has given me so much trouble to set up or incorporate into my project that i have almost given up on the whole idea of developing for the platform.

    Since its very much wildly encouraged to use the MVVM pattern, is it necessary to create compelling Apps with it or is there that much great advantage in using it over an Event based interaction because i plan on continuing with my event based module and then use an MVVM from scratch in my next windows phone project when i have solid knowledge on it. What do you guys suggest?. Thanks in Advance
    Last edited by iparrot; 2013-09-25 at 22:31.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2011
    Location
    Portugal
    Posts
    948

    Re: MVVM or Not to create great Apps

    MVVM as many advantages on concern isolation, binding, and many other things related with the patters in self. There are also toolkits like Caliburn micro that has a ton of helpers to work with it.

    Saying that, you do not need to use that pattern. MVVM is a pattern and as such you can out it out. You will probably return to it sooner or later, but there is nothing preventing you from using an event driven approach. I still recommend that you try to use MVVM. It may take a bit until you get the hand of it, but when you do you will see the benefits.

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2013
    Location
    Dublin, Ireland
    Posts
    552

    Re: MVVM or Not to create great Apps

    First off, MVVM is necessary for lots of reasons. And decent native app, web app or backend systems need a framework and/or patterns, otherwise it's an un-ordered mess.

    I think the problem with MVVM (which is very similar to MVC btw) is that Microsoft have no reference implementation - so everyone does it differently, which creates a new problem. Personally, I like small opinionated frameworks ideally written by someone who makes real apps (not just 2 page demo apps!). And for that reason I would recommend Caliburn.Micro (CM).

    Obviously if you're new to C# of Windows Phone, there is going to be a learning curve and adding to that might not help, but once setup in a project, CM can handle a number of things automatically for you without you having to right code. It also enforces, for the most part, a structure on your files and code. Some quick examples...

    a) If I have a page (or view) called /Views/MainView.xaml.cs then it will automatically bind to /ViewModels/MainViewModels.cs
    b) If I want to save/restore data when navigation to and from that page, I just add a class to /Storage/MainViewModelStorage.cs and it's linked up

    Here's a great tutorial to get you started... http://wp.qmatteoq.com/first-steps-w...-8-the-theory/
    Last edited by theothernt; 2013-09-28 at 12:40.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2011
    Location
    Portugal
    Posts
    948

    Re: MVVM or Not to create great Apps

    Quote Originally Posted by theothernt View Post
    Here's a great tutorial to get you started... http://wp.qmatteoq.com/first-steps-w...-8-the-theory/
    Thats a good tuturial.

  5. #5
    Regular Contributor
    Join Date
    Aug 2012
    Location
    Rhine Valley
    Posts
    92

    Re: MVVM or Not to create great Apps

    If you're not familiar with MVVM or Blend, it might be easier to begin without it. MVVM light is in my opinion meant to reduce code-behind of the xaml pages in order to enable designing in Blend.
    You'll be completely able to use data-binding without the need for MVVM.
    Later it will be worth viewing Laurent Buignon's Videos about MVVM Light and then deciding if you take zhr road to MVVM.

  6. #6
    Registered User
    Join Date
    Oct 2013
    Posts
    1

    Re: MVVM or Not to create great Apps

    You can quickly start learning Windows Phone development without using MVVM for some things, but sooner or later you'll need to learn it for apps that have more than a few pages / controls.

    I'd recommend you persevere with MVVM as when it becomes clear, you'll see how it benefits your development. Changing a model and having it automatically rendered on your views is an excellent concept and much easier than setting the text of controls via code.

    During my time as a developer, I've always found it easier to learn the basic way of doing things first before learning frameworks or patterns. For WP, I think the same concept holds. I'd recommend learning the basics of WP8 development, then MVVM and then looking at other frameworks to see how they can benefit you.

Similar Threads

  1. MVVM, Inheritance and custom components
    By StepTNT in forum Windows Phone General
    Replies: 9
    Last Post: 2013-09-18, 11:00
  2. VideoBrush.SetSource(PhotoCaptureDevice) in ViewModel? (MVVM)
    By fabianhenzler in forum Windows Phone General
    Replies: 2
    Last Post: 2013-07-15, 22:04
  3. Replies: 2
    Last Post: 2013-05-13, 05:01
  4. newbie: confusing multiple sdk - want to create java apps on N8
    By gurpal2000 in forum Mobile Java General
    Replies: 9
    Last Post: 2011-01-17, 22:10
  5. Replies: 1
    Last Post: 2007-11-20, 07:42

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×