Thursday, November 25, 2010

Advantage of HttpHandler - A Certificate example

Scenario

You are a developer at Grade Nineteen University. One of the recent requirments the management had is to create an online certificate.
So that the students that pass out should be able to view their Certificates online. This will definitely add some technological edge to the university.

Requirement
The student will be given his own certification url as following: http://www.cert19.edu/certificates/100.cert

On accessing the url, the following Certifcate image will be displayed for the student id: 100

(100.cert should be interpreted in server as "Show Certificate for Student Id as 100")

Easy Way of Implementation - But not the Best

The first thought of implementation would be to create jpg files for all the students and copy them into the cert folder of the website. This approach is feasible but the following overheads would exist:

  • For 1000 students that pass each year, 50 MB disk space would be required.
  • While backing up database of site, we have to do backup of jpg files too, which is tedious.
If we have to take a backup of the site, we have to copy the files separately and do the database backup separately.


Http Handlers for the Rescue - A better Approach

We can achieve the same behavior with little overheads รข€“ by avoiding files creation for certificates.

We can use the database records to dynamically create certificate based on the student url.

By default the ISAPI handlers, handle the .aspx url extensions. We have to create a new handler for .jpg file handling that would be redirected to our certificate creation code


View  more detail : http://www.c-sharpcorner.com/UploadFile/40e97e/3806/Default.aspx

Introducing Web Client Software Factory (WCSF)

The Web Client Software Factory is a framework for developing ASP.NET and Ajax applications implementing proven patterns and practices. This framework is part of Microsoft Patterns & Practices.

Advantages

Some of the core advantages of using the WCSF are:

Module based Development: We can create each business module as separate library and it provides reusability and easier maintainability.

Model View Presenter: Separation of User Interface giving more flexibility in manageability and unit testing.

Service Dependency Attribute: Allows injection of class instances to modules, resulting in instance reusability and less instance creation overheads

Overall it would be a good to have framework at the cost of learning.

Installation for Visual Studio 2010

It would be a two step process.

Step 1: First we have to install Guidance Automation Extensions for 2010. Guidance Automation provides the infrastructure for automated project creation actions inside Visual Studio IDE.

http://visualstudiogallery.msdn.microsoft.com/en-us/25e4b5e9-65e4-4950-967d-5f1e6a9dcbeb

image1.gif

Click on the Install button to proced.

View more Detail Click http://www.c-sharpcorner.com/UploadFile/40e97e/4402/