Wednesday 2 April 2014

Architectural Design Patterns including MVC


          ASP.NET MVC


Introduction:

Architectural Design Patterns:
Design patterns are recognized solutions to common problems defined originally by the Gang of Four(GoF) patterns.
 Some are
1.Factory method
2. Abstract Factory
3. 3-Tier / N-Tier
4. Template method
And for detailed information please visit following link:
http://wiki.asp.net/page.aspx/276/design-patterns/

Model View Controller Pattern:
What is MVC?
  • Mvc is a pattern
    • Acronym for Model ● View ● Controller
    • Separation of concerns
The pattern isolates “domain logic” (the application logic for the user) from the user interface (input and presentation), permitting independent development, testing and maintenance of each.
Advantages
*Better Separation of Concerns
*Testability
*Model Binder is excellent !
*No Viewstate anymore
*SEO friendly url’s (automatic)
*Complete control over Html output and HTML based
*Easier integration with Javascript / Jquery
*Building an Internet site where HTML,
*performance, and scalability are paramount ASP.NET MVC may be better suited
Disadvantages
•Not as RAD as using Web Forms
•No drag and drop experience
•Doesn’t build on all your experience with
ASP.NET server controls
•Encourages use of design patterns and best practices
Standard MVC View
ASP.NET MVC is a framework for building scalable, standards-based web applications using well-established design patterns and the power of ASP.NET and the .NET Framework
Releases
• Transparently
– Regular source code releases on CodePlex
– Previews 1 – 5, Beta thus far. 6 releases!
– Community feedback via forums, etc…
• Agilely
– 94% Code Coverage/1051 unit tests
– Daily Triage Meetings and weekly design
meetings
– Small agile team
FolderPurpose
/ControllersControllers respond to input from the browser, decide what to do with it, and return response to the user.
/ViewsViews hold our UI templates
/ModelsModels hold and manipulate data
/ContentThis folder holds our images, CSS, and any other static content
/ScriptsThis folder holds our JavaScript files
View:
The stuff for displaying whatever it is that you are supposed to be displaying in your application.
Controller:
The bit that connects the view and the model.
Model:
The classes that model the domain or subject matter for which you are writing software.
ASP.NET MVC working mechanism:
Step 1
Incoming request directed to Controller
Step 2
Controller processes request and forms a data Model
 
Step 3
Model is passed to View
Step 4
View transforms Model into appropriate output format
Step 5
Response is rendered
ASP.NET MVC App Execution
Example
• For example, consider the following URL:
/Job/Details/3
• This URL is parsed into three parts like this:
Controller = JobController
Action = Details & Id = 3
• The default route includes default values for
all three segments. The default Controller is
HomeController, the default Action is Index,
and the default Id is an empty string.


No comments:

Post a Comment