Tuesday, July 24, 2012

MVC vs MVP vc MVVM

During one of the discussion internally with practice team members, we talked about few differences between Model View Controller (MVC), Model View Presenter (MVP) and Model View ViewModel (MVVM) patterns. Breifly looked at the web and I could consolidate the final understandings as below :

MVP

- Presenter contains the business logic for View
- Presenter binds data to model
- Presenter is exposed through interface
- View is called directly
- View does not bind directly to the model it mediates through presenter
- This is achievable in ASP.Net web applications

MVC

- Controller determines which view to display
- View is bound to a model
- View is stateless and no code behind required
- This is the pattern used in ASP.Net MVC

MVVM

- View Model is also called presentation model which acts as intermediate for View to talk to.
- View Model will talk to the underlying domain model (like Entity Framework)
- Mostly used in Silverlight and WPF where the control binding to data happens through the presentation model and does not need to have properties in the view and have UI business logic to it.


There are hell lot of blogs and articles about these to help you more but what I thought is to put a simple note about all.

Any change in your view about this blog, please present it to me :).

References :
http://stackoverflow.com/questions/2056/what-are-mvp-and-mvc-and-what-is-the-difference

All in one code framework plugin is introduced

This one from codeplex would be really useful for us‘dayin-dayout’ and it really avoids copying from google. As of now they have just started building the samples and due course of time we may get code sample with project for everything we need.
 
Just visit the http://1code.codeplex.comand download the browser plugin from http://visualstudiogallery.msdn.microsoft.com/4934b087-e6cc-44dd-b992-a71f00a2a6dfto use in visualstudio ( supports till RC 2012) or can be viewed separately in the browser.
 
Once plugin installed, just go to the TOOLS and click on‘Search Code Sample’ and search for the code you need. During coding if you started typing a code for a mail component and you need to see if this code repository can help you find one for you, then just right click on the method name or class name by which the sample will be searched.
 
Try it out….. For sure it’s a useful plugin for all the devs.
 
Note : Coding guideline used for building these samples are also exposed for us to use / review. 
Enjoy… reusing the code.

"403 : Access denied" in windows azure application

While creating an application to deploy into Windows Azure (Cloud Services), I encountered a weird issue that could not be solved by anyone (read a lot of blog).

The issue is "403 : Access denied" was getting shown when I hit the production url (in my case : questionaire.cloudapp.net). I could not find anyreason why it should throw an error as I have just followed the steps in windows.azure.com tutorials and scott's blog. Really there is nothing much to do to get an app to be deployed into cloud.

Finally I found the issue to be the OS type that was allocated to me in cloud services host vm. It was having Windows 2008 SP1 and when I changed it to Windows 2008 R2, it worked.
Hope others do not need to waste their time looking at it as firewall issue, ACL issue, code isssue etc :)

First app in Cloud....

I have been digging through Windows Azure for few days and finally I could get a sample Questionaire application deployed to the cloudapp.net (windows azure - cloud services).


Also took a couple of sessions on Windows azure to the internal dotnet team.