Design the application architecture - Objective 1.1: Plan the application layers Flashcards
What folder usually contains the model or data classes for an application?
The Models folder
What is one advantage of placing model classes in a separate assembly?
To allow the model classes to be used by more than one application.
What is a domain model?
It represents the data you work with in the middle tier of an application.
What is a view model?
It represents the data you work with in the presentation layer. Any data present in the view comes from the view model.
What is an input model?
It represents the data submitted from the client to the server with each individual HTTP request.
What are model binders?
A simple way to map posted form data to a type and pass that type to an action method as a parameter.
What is the DefaultModelBinder?
The default model binder in ASP.Net MVC that automatically maps input values to model properties if the names match exactly.
How do you create a custom model binder?
Implement the IModelBinder interface.
What is one reason to use custom model binders?
To support abstract classes and interfaces. The default model binder does not support them.
What do controllers do?
Handle incoming requests, handle user input and interaction, and execute application logic.
What class do controllers inherit from?
ControllerBase
What are action methods?
Methods on a controller that map to the user’s interactions with the server.
What is an action result?
The outcome from calling an action method.
Where is the routing table stored?
In the global.asax file.
What does routing do in ASP.Net MVC?
Maps urls to controllers and action methods.
What is the default routing format?
{controller}/{action}/{id}
What does the routing engine do?
Analyze urls and pass control to a route handler.
What is a route handler?
The route handler finds an HTTP handler or class implementing the IHttpHandler interface to handle the request.
What is the default handler in ASP.Net MVC?
MvcHandler
What does the MvcHandler class do?
Extracts the controller name from the request and sends it to a controller factory to return the appropriate controller.
How do you create a custom controller factory?
Create a class that implements the IControllerFactory interface.
What does the ActionName attribute do?
Gives an action method a different name.
Ex:
[ActionName(“MyName2”)]
public ActionResult MyName()