Lesson 10 | Course Project |
Objective | Add user customization to the T-shirt store. |
Customization Course Project
In this module, we have covered ASP's Server and Session objects. In particular, we have looked at the latter's Session_OnStart
event, which reads the global.asa file to capture session variables that can be employed to customize
a user's environment.
you have also learned about the Advertisement Rotator component, which works with a schedule file to vary the display of banners on your web pages.
In this portion of the course project, you will write the code to initialize several session variables by editing the global.asa file.
You will also incorporate rotating ads with your online t-shirt catalog by creating the ad rotator and the schedule file.
Initialize Asp Session - Exercise
We understand that "task" is an overloaded word, and the fact that the .NET Framework includes a Task class only complicates matters.
Therefore, what we mean by the word task is based on the context in which it appears.
The Task classes we will implement in the task-management service (there are three of them, at different layers in the application) map to the problem domain.
Please take care to avoid confusing them with the .NET Framework's Task class.
This same example under the ASP.NET Web API would involve creating a controller instead of a WCF service class.
The method for fetching a Task object exists on the controller, but it is no longer defined by a contract, as it is in WCF.
The controller might look like this:
public class TasksController : ApiController{
private readonly IRepository _repository;
This course will cover REST principles sufficiently for you to build services using the ASP.NET Web API.
However, if you are interested, you can find several good books that cover the full breadth of the REST architecture.
You might also find it interesting to read Chapter 5 of Fielding's doctoral dissertation, where the idea of REST was first conceived.
You can find that chapter here:
dissertation/rest_arch_style.htm
Before moving on, let us quickly address a point that some may be thinking about: you can indeed create REST services with WCF. Looking around the Internet, you can certainly find arguments on both sides of the ASP.NET
Web API versus WCF debate (for building RESTful services).