locked
Mobile App Architecture - Using MVC and Web Services RRS feed

  • Question

  • I've read a number of threads where folks debate whether a Web Service is a model - or should be simply referenced and called by the controller.

    I want to create a mobile app.  Would the best way to proceed be to use MVC with the web service as a model?

    Tuesday, May 24, 2011 4:02 AM

All replies

  • The model doesn't have to use a web service but it can do.

    The argument for web services would be if you will re-use them for some other reason.

    But if you're not going to re-use them and your servers are both on the same network then web services are an overhead.

    Tuesday, May 24, 2011 9:07 AM
  • Thanks for the response Andy.   In my case using web services is the only supported method of performing UPDATE and CREATE actions.  Hitting the database directly for updates is not supported.

    MVC looks attractive to me because of the lightweight nature of the pages. 

    Are my assumptions good?

    Tuesday, May 24, 2011 10:57 AM
  • MVC can be lighter weight than webforms but that's not necessarilly much of an issue.

    The difference is in the hidden data transmitted in webforms.

     

    Tuesday, May 24, 2011 11:50 AM
  • I agree with Andy's reply.

    I have a followup to your question...

    What is your target device for Mobile app.  If you are thinking about WP7, then you should consider MVVM + REST Services for your application.  If it is Android, MVC + Web Service is a good pattern.  I dont know the appropriate pattern for iOS device.


    Gaja Kannan
    Tuesday, May 24, 2011 6:01 PM
  • Thanks for the advice...My target platforms are the Blackberry, Windows Mobile 7, and iPhone -  in that order.  
    Tuesday, May 24, 2011 6:11 PM
  • so this is a web application optimized for a device viewing compared to a native mobile app?
    Gaja Kannan
    Wednesday, May 25, 2011 2:11 AM
  • Ah yes, that's a good point.

    A "mobile app" implies native code.

    And you wouldn't want to use MVC at all.

    In that case you want to take a look at mono.  You'd have a separate app per operating system and port code.  So you might have data provided by MVC and MVC RIA web services.  Use xaml for your front end on winphone.... Not sure how advanced moonlight is.  Maybe you'd need forms on the other devices or maybe you could use xaml.

    In many ways, a web page based approach is simpler.

    Thursday, May 26, 2011 9:00 AM