Design the application architecture - Objective 1.1: Plan the application layers Flashcards Preview

Exam 70-486: Developing ASP.NET MVC 4 Web Applications > Design the application architecture - Objective 1.1: Plan the application layers > Flashcards

Flashcards in Design the application architecture - Objective 1.1: Plan the application layers Deck (57)
Loading flashcards...
1

What folder usually contains the model or data classes for an application?

The Models folder

2

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.

3

What is a domain model?

It represents the data you work with in the middle tier of an application.

4

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.

5

What is an input model?

It represents the data submitted from the client to the server with each individual HTTP request.

6

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.

7

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.

8

How do you create a custom model binder?

Implement the IModelBinder interface.

9

What is one reason to use custom model binders?

To support abstract classes and interfaces. The default model binder does not support them.

10

What do controllers do?

Handle incoming requests, handle user input and interaction, and execute application logic.

11

What class do controllers inherit from?

ControllerBase

12

What are action methods?

Methods on a controller that map to the user's interactions with the server.

13

What is an action result?

The outcome from calling an action method.

14

Where is the routing table stored?

In the global.asax file.

15

What does routing do in ASP.Net MVC?

Maps urls to controllers and action methods.

16

What is the default routing format?

{controller}/{action}/{id}

17

What does the routing engine do?

Analyze urls and pass control to a route handler.

18

What is a route handler?

The route handler finds an HTTP handler or class implementing the IHttpHandler interface to handle the request.

19

What is the default handler in ASP.Net MVC?

MvcHandler

20

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.

21

How do you create a custom controller factory?

Create a class that implements the IControllerFactory interface.

22

What does the ActionName attribute do?

Gives an action method a different name.

Ex:
[ActionName("MyName2")]
public ActionResult MyName()

23

What does the AcceptVerbs attribute do?

Specifies which HTTP verbs an action method will respond to.

Ex:
[AcceptVerbs(HttpVerbs.Get | HttpVerbs.Post)]
public ActionResult MyAction()

24

What does the NonAction attribute do?

Indicates that a controller method is not an action.

25

What does the OutputCache attribute do?

Marks an action method whose output will be cached.

Ex:
[OutputCache(Duration=60)]
public ActionResult MyAction()

26

What does the ValidateInput attribute do?

Indicates whether an action method's parameters must be validated.

Ex:
[ValidateInput(false)]
public ActionResult MyAction()

27

What does the HandleError attribute do?

Used for handling exceptions thrown by the action method to which it is applied.

Ex:
[HandleError(View="DivideByZero")]
public ActionResult MyAction()

28

How do you create a custom action filter?

Create a class that inherits from the ActionFilter class.

29

When should you use asynchronous processing in your action methods?

When the action method is long-running, network-bound, or IO-bound, or when you want to allow the user to cancel running the method.

30

How do you make an action method asynchronous?

Mark it as async and change its return type to Type.

Ex:
public async Task List()
{
...
}