mvc architecture in asp.net by nyros developer
DESCRIPTION
MVC Architecture in ASP.Net By Nyros DeveloperTRANSCRIPT
![Page 1: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/1.jpg)
![Page 2: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/2.jpg)
AgendaAgenda
What is ASP.NET MVCWhat is MVCMVC FlowRoutingUsing Ajax & SecurityChoosing Between MVC and Web formsWhich one is better ?Summary
![Page 3: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/3.jpg)
What is ASP.NET MVC?What is ASP.NET MVC?
A new Web Application Project type
Simply an option• Not a replacement for WebForms• Builds on top ASP.NET• Manual vs Automatic Transmission
![Page 4: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/4.jpg)
What is MVC?What is MVC?
ModelModel
ControllerControllerViewView
![Page 5: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/5.jpg)
Separation Of ConcernsSeparation Of Concerns
Each component has one
responsibility
– SRP : Single Responsibility Principle
–More easily testable
Helps with concurrent development
![Page 6: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/6.jpg)
• Not the new Web Forms 4.0
• Not replacing Web Forms, but Adds to it
• It can not use Web Controls
• Not a whole new engine but sits on ASP.NET engine
• Not the best solution for REST
What MVCWhat MVC is not ?is not ?
![Page 7: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/7.jpg)
Maintain Clean Separation of Concerns
• Extensible and PluggableEnable clean URLs and HTMLGreat integration within
ASP.NET
• Tooling Support
![Page 8: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/8.jpg)
MVC Flow MVC Flow
![Page 9: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/9.jpg)
![Page 10: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/10.jpg)
![Page 11: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/11.jpg)
URLs -> application -> Controller Action
Construct outgoing URLs
– Constructed URLs can be used to call back to Controllers/Actions
Routing EngineRouting Engine
![Page 12: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/12.jpg)
Sequence Diagram ASP.Net MVC Flow
![Page 13: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/13.jpg)
Ajax is not just “Update Panel” You can use
– Page methods– Web Services
They all require you to write a lot of javascript
MVC Ajax helps with Forms and ActionLinks !!
Ajax SupportAjax Support
![Page 14: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/14.jpg)
Built in Controller for LoggingUsing ASP.NET Security ProvidersHaving the ability to control the security
level of each controller method
Security SupportSecurity Support
![Page 15: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/15.jpg)
Choosing Between WebForms and MVCChoosing Between WebForms and MVC
Now that Asp.Net is much more mainstream at work,
The question is asked time and again as to which one should be used while developing a Web Application.
One possible way to answer this question is to do a analysis of both the frameworks.
![Page 16: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/16.jpg)
![Page 17: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/17.jpg)
![Page 18: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/18.jpg)
ASP.Net MVC VS Web Forms
Uses the ‘Front Controller’ pattern. There is a single central controller for all pages to process web application requests and facilitates a rich routing architecture
At its core, ASP.NET MVC was designed to make test-driven development easier. You ‘can’ test your Controller without instantiating a View and carry out unit-tests without having to run the controllers in an ASP.NET process.
Uses the ‘Page Controller’ pattern. Each page has a code-behind class that acts as a controller and is responsible for rendering the layout.
At its core, you ‘cannot’ test your controller without instantiating a View. There are ways to get around it using tools
![Page 19: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/19.jpg)
ASP.Net MVC VS Web Forms
A thorough understanding of how HTML, CSS and JavaScript work together is required. The advantage is you can do a lot of jQuery and AJAX stuff in an efficient and simple manner than you would do in an ASP.NET application.
You lose the 'drag and drop' quick model of building your web applications.
Deep understanding of HTML, CSS and JavaScript is not required to a large extent since the WebForm model abstracts a lot of these details and provides automatic plumbing. While abstracting details to provide ease of use, sometimes a solution is overcomplicated, than it needs to be.
Can drastically reduce time while building up intranet and internet applications that use a lot of controls (drag and drop model).
![Page 20: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/20.jpg)
WebForms ???????
MVC ??????
Which one is better ?
![Page 21: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/21.jpg)
![Page 22: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/22.jpg)
Not a replacement for WebForms
– All about alternatives
Fundamental
– Same team that builds WebForms
Summary
![Page 23: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/23.jpg)
![Page 24: MVC Architecture in ASP.Net By Nyros Developer](https://reader036.vdocuments.net/reader036/viewer/2022062312/5553a8afb4c905d9448b475b/html5/thumbnails/24.jpg)