edit-article
Home
Up
Delete
Article Name:
Article Description:
[55:00]VIDEO-SUMMARY Introduction to MVC - Lesson 1 - by Jon Galloway and Christopher Harrison of Microsoft
Chapter ID/Name:
Status:
Write
Writing
Written
Add Photo:
Owner ID:
Content:
use HTML
Edit Content
<h1 style="text-align: center;">Introduction to MVC</h1> <h2 style="text-align: center;">basics of MVC and the moving parts</h2> <h2>[WHAT]</h2> <ol> <li>] VIDEO SUMMARY - summary notes on the video, this lesson explains what MVC is, why you should want to use it and then demonstrates how to create an MVC project</li> </ol> <h2>[WHY]</h2> <ol> <li>] MVC advantages over msft forms programming paradigm</li> <li>] about MVC</li> <li>] MVC hello world demo and explaination</li> </ol> <h2>[WHERE]</h2> <ol> <li><strong>] WATCH THE FULL VIDEO</strong></li> <ol> <li> <div class="inlineBlock overview-tab-headers semi-bold" title="Basics of MVC and the Moving Parts" data-bind="html: title(), attr: { 'title': title() }">] <a href="https://www.microsoftvirtualacademy.com/en-US/training-courses/introduction-to-asp-net-mvc-8322" target="_blank">Microsoft MVC intro</a> - by microsoft's <a href="/view/person?id=347" target="_blank">Jon Galloway</a> and Christopher Harrison</div> </li> </ol></ol> <h2>[WHEN]</h2> <ol> <li>] 2014-06-24 - produced</li> </ol> <h2>[EXAMPLE]</h2> <ol> <li><strong>[00:00] introduction</strong></li> <ol> <li>] intro to is</li> </ol> <li><strong>[04:00] expectations</strong></li> <ol> <li>poll of people who are taking this course,</li> <li>- 18% new dev</li> <li>- 10 know html, new to .net</li> <li>- 12 exp .net , new to web forms</li> <li>- 30 exp. with forms, new to mvc</li> <li>- 28 some experience with mvc, want to learn more</li> <li>- 2 lion tamers</li> <li>setting expections - trying to connect with people who are 'relatively'new</li> <li>in particular talking to web forms developers</li> <li>src code is available on github</li> <li>up front apology in advance, recorded live</li> <li>MVA - points</li> </ol> <li><strong>[08:45] Basics of asp.net MVC</strong></li> <ol> <li>diagram [sites + services] at the top, [asp.net] at the bottom, in the middle, ] web pages, ] web forms, ] MVC, ] SPA ] signalR, ] web api ]</li> <li>MVC is a different coding model</li> <li>running on top of asp.net</li> <li>in [web forms, web pages] user request is mapped to a file, file does something and returns html</li> </ol> <li><strong>[c]ontroller</strong></li> <ol> <li>in MVC - request comes into a method in a controller, user is calling a method on a class</li> <li>little bit of magic in how the requests gets routed into the right class, right method, will look into that later</li> <li>migrating to good class design VS managing a lot of different files</li> </ol> <li><strong>[m]odel</strong></li> <ol> <li>a lot of time, the result of a controller action is 'data', aka a model, just a class</li> <li>model is just the data, a collection, an array, a string, /NOT hooked into your database, just the data</li> <li>dont know where they came from or where they are going</li> </ol> <li><strong>[v]iew</strong></li> <ol> <li>visually represents the model, the views job is to take the model info and turn it into html</li> <li>seperatation of concerns</li> <li>no logic - should be in your view, controller should do the</li> <li>NOT all the code goes in the controller</li> <li>the MVC flow is NOT your whole application</li> </ol> <li><strong>[19:30][WHY - MVC]</strong></li> <ol> <li>every web app needs structure</li> <li>mvc helps you stay organized</li> <li>often less code, not more</li> <li>smoother learning curve as your project grows</li> <li>lends itself to writing well structured code much more easily</li> <li>will typically find yourself with more classes and methods,</li> <li>more work in starting with MVC, but its worth it</li> <li>in web form, controls are handling html and css, some issues</li> <li>- diagram asp.net page life cycle -</li> <li>- multiple pages within a single page, (master, product, cart)</li> <li>- each with page life cycle,</li> <li>- controls work by handling "view state" controls make it seem like persistant state, a lot of steps are being done, that you dont see</li> <li>- in web forms, you don't have direct control of id's and classes, they can be controlled, you have to go and do them specifically</li> <li>- MVC doesnt have</li> </ol> <li><strong>- MVC designed for testability</strong></li> <ol> <li>- testing your code in code, a safety net / seat belt</li> <li>- verify behaviour of your code</li> <li>- not covered in this course, but really important and you should do it</li> <li>- point is, MVC is designed to make unit testing easy, test everything in isolation</li> </ol> <li><strong>[34:00] hello world - file new project </strong></li> <ol> <li>point is making it more code focused, not drag and drop, wysiwyg</li> <li>file | new project | new web application</li> <li>options ( empty, web forms, MVC, API, SPA, FB, Azure Service )</li> <li>can include multiple types in the (forms and MVC) in the same application, check the appropriate boxes at the bottom of the dialog</li> <li>options - start with empty, add in whatever you need</li> <li>can share services across different types of paradigms,</li> <li>> CHECKBOX - azure - no demo of deployment today, but can click check box in VS to publish to your azure web site</li> <li> free web site and free 20 mb sql server db on msft</li> <li>> CHECKBOX - add unit tests -</li> <li>- as app starts, NUGET packages are added, automatically installs dependancies</li> <li>- MVC support is added as a nuget package</li> <li>- a lot of good information on the start screen of the demo app</li> </ol> <li><strong>[45:45] understanding an MVC project, the directory structure</strong></li> <li> SOLUTION(.sln) - the project name, file used by VS to <br />- Properties<br />- References<br />- /App_Data<br />- /App_Start<br />- /Content<br /><strong>- /Controllers - </strong>a class, contains methods, inheirits from controller, create action methods, when someone calls into the class, the action method will be the code that is executed<br />- /fonts<br /><strong>- /Models - </strong>contains classes for your data<br />- /Scripts<br /><strong>- /Views - </strong>contains your view(s), required, framework will look here for view code,</li> <li>-/Shared - contains files used across multiple , _SiteLayout.cshtml, <br />- Global.asax<br />- packages.config<br />- projectReadMe.html<br />- Startup.cs</li> <li>] important to understand - conventions that map -</li> <li>- ex your are in the home controller, your "Index" method says ...</li> <li>return View();</li> <li>- this is where "conventions" kick in, b/c you are in Home controller, it looks in views for \Home, then for Index view within that directory, b/c the names match you dont have to specify a view name</li> <li>- uses bootstrap, automatically scales based upon device type,</li> <li><strong>[50:00] REVIEW</strong></li> <ol> <li>what is MVC</li> <li>why you should care</li> <li>file new project - whats involved in creating a new project</li> <li>controllers</li> <li>controllers returning a view</li> <li>no model data used</li> <li>next lesson is on controllers</li> </ol></ol> <h2>[HOW-TO]</h2> <ol> <li>]</li> </ol> <h2>[REFERENCE]</h2> <ol> <li>] <a href="/view/task?id=5359" target="_blank"># 5359 - overview series</a> ] reference ] to do, ] done</li> </ol> <p> </p> <h1 style="text-align: center;">quiz</h1> <p>results = 4/5</p> <p>x] what are the different types of authentication you can use on an MVC project</p> <h1 style="text-align: center;"> </h1>