concept Code Camp Server in category asp.net

appears as: Code Camp Server
ASP.NET MVC in Action with MvcContrib, NHibernate, and More

This is an excerpt from Manning's book ASP.NET MVC in Action with MvcContrib, NHibernate, and More.

Rescuing the URL means controlling those that control applications. Although routing is not core to all implementations of the MVC pattern, it is often implemented as a convenient way to add an extra level of separation between external inputs and the controllers and actions which make up an application. The code required to implement routing using the ASP.NET MVC Framework is reasonably trivial but the thought behind designing a schema of URLs for an application can raise many issues. In this chapter, we’ll go over the concept of routes and their relationship with MVC applications. We’ll also briefly cover how they apply to Web Forms projects. We’ll examine how to design a URL schema for an application, and then apply the concepts to create routes for Code Camp Server, our sample application. Because routes are the front door of your web application, we’ll discover how to test routes to ensure they are working as intended. Now that you have an idea of how important routing is, we can start with the basics.

5.5. Creating routes for Code Camp Server

Now that we are armed with the techniques for building routes for an application, let’s apply this to Code Camp Server. Table 5.6 shows the desired URLs for the application. It’s important to list all of the desired entry points to your website. We’ll use this as a basis for route testing later.

Table 5.6. Desired URLs for Code Camp Server

Example

URL

Purpose

1

/

Redirect to current conference

2

/<conferenceKey>

See the details for the conference specified

3

/<conferenceKey>/edit

Edit the conference (admin only)

4

/<conferenceKey>/speakers

See the list of speakers for the conference

5

/<conferenceKey>/speakers/<id>/<personKey>

See the details of a speaker

6

/<conferenceKey>/sessions

See the list of sessions

7

/<conferenceKey>/sessions/new

Create a new session (admin only)

8

/<conferenceKey>/sessions/<id>/<sessionKey>

See the details of a session

9

/<conferenceKey>/schedule

See the schedule of the conference

10

/<conferenceKey>/attendees

See who’s coming

11

/<conferenceKey>/attendees/new

Create a new attendee

12

/<conferenceKey>/attendees/<id>/<personKey>

See the details of an attendee

13

/login

Log in to the site

14

/conference/list

List the conferences on the site (admin only)

15

/conference/new

Create a new conference (admin only)