Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'m a fairly experienced desktop .NET developer with a solid feel for MVVM and

ID: 642008 • Letter: I

Question

I'm a fairly experienced desktop .NET developer with a solid feel for MVVM and WPF, and I've worked with JavaScript, jQuery and HTML/CSS in the past - though I'm pretty dated and haven't had a ton of experience with the new frameworks (Angular, et al).

My question is, for anyone who has had to do it, what are the key pain points and differences I should be aware of when working on an ASP.NET MVC project?

I have a general sense of the MVC pattern and where it differs from MVVM, but ASP.NET tricks me by looking familiar, but with subtle and not-so-subtle differences in implementation and execution. I'm helping out with an ASP.NET project at work, and while my C# knowledge helps, my desktop habits seem to be a liability. Links to material I can review would be appreciated, or a succinct summary of what I need to change about my mindset.

Explanation / Answer

I went from MVC to MVVM and found that the main difference is that with MVC you deal with a single request from Controller to Model to View over and over, which you can turn into a single-page type app with AJAX.

In MVVM, the async of data/view is taken care of via properties notifying anything bound to them that the value has changed. Your Views can refresh themselves without having to re-do the entire MVC call and re-draw everything - instead only the affected properties are re-drawn so to speak.

I've found the async nature of MVVM to be favorable over MVC. The biggest hurdle for me has been trying to adhere strictly to MVVM pattern and not putting code in View Code-Behind or make Models/VMs aware of any Views etc. For smaller projects, it doesn't really matter.

Over-simplified example:

MVC: $user submits login request through controller, controller builds new View with $user defined from Model

Controller [$msg = Hello, $user!] => Model [$user = Bob] => View ["Hello, Bob!"]
MVVM: $user submits login request through view, view model updates property with $user defined from Model, Property Notifies View that it has changed and View is updated (without having to re-draw or re-submit the entire process)

ViewModel [$msg = Hello, $user!] => Model [$user = Bob] => View ["Hello, Bob!"]

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote