Porting web application to different database server
page 1 of 5
Published: 18 Dec 2003
Unedited - Community Contributed
Abstract
This article describes my considerations about porting web applications from one database server to another avoiding horror of rewriting all elements.
by Lech P. Szczecinski
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 21866/ 47

Preface

       Let’s consider that we’re great developers (aren’t we?) and we have huge (several dozen pages with over a doze database access points each) web application designed for work with MS SQL Server2000 (in fact it could be any other database server; at this point it has no matter). Customer has found our web application very suitable for his needs and wants to buy it. He wants to install it on his web server without any changes (great, yeah?). With no changes but with one exception: he has Oracle database server (again it has no matter that it’s Oracle). So we’ve some work to do: porting.
       About such situation we’ve to think on implementing stage to write our web application in such way to provide as few work as possible with porting. So let’s think how to do that to avoid horror and terrible headache during such work.
       To make my article more clear, let’s consider that we have web page designed as:


<%@ Page language="c#" Codebehind="Article.aspx.cs" AutoEventWireup="false" Inherits="LesioS.Article" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
 <title>Article</title>
 <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
 <meta name="CODE_LANGUAGE" Content="C#">
 <meta name="vs_defaultClientScript" content="JavaScript">
 <meta name="vs_targetSchema" content="
http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
 <form id="Form1" method="post" runat="server">
  <asp:TextBox id="txtNumber" runat="server"></asp:TextBox>
  <asp:TextBox id="txtSetting" runat="server"></asp:TextBox>
  <asp:DropDownList id="ddlValue" runat="server" DataTextField="ValueName" DataValueField="ValueId"></asp:DropDownList>
  <asp:Button id="btnLoad" Text="Load" Runat="server"></asp:Button>
  <asp:Button id="btnSave" Text="Save" Runat="server"></asp:Button>
 </form>
</body>
</HTML>


       And following code-behind:


using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace LesioS
{
 public class Article : System.Web.UI.Page
 {
  protected System.Web.UI.WebControls.TextBox txtNumber;
  protected System.Web.UI.WebControls.TextBox txtSetting;
  protected System.Web.UI.WebControls.Button btnLoad;
  protected System.Web.UI.WebControls.Button btnSave;
  protected System.Web.UI.WebControls.DropDownList ddlValue;
 
  private void Page_Load(object sender, System.EventArgs e)
  {
   // Put user code to initialize the page here
  }

  #region Web Form Designer generated code
  override protected void OnInit(EventArgs e)
  {
   InitializeComponent();
   base.OnInit(e);
  }
  
  private void InitializeComponent()
  {   
   this.btnLoad.Click += new System.EventHandler(this.btnLoad_Click);
   this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
   this.Load += new System.EventHandler(this.Page_Load);

  }
  #endregion

  private void btnLoad_Click(object sender, System.EventArgs e)
  {
  
  }

  private void btnSave_Click(object sender, System.EventArgs e)
  {
  
  }
 }
}


       As you can see our page is rather simple due to easy show interesting aspects of problem. Hold in mind that our application has dozen more complicated pages than that one.


View Entire Article

User Comments

Title: N-tier Porting   
Name: Ben Gik
Date: 2012-02-05 5:34:44 PM
Comment:
Hi,
You made me understand porting and I really learn some tricks. Good programmers. Keep it up.
Title: Great but...   
Name: Omar
Date: 2007-05-01 11:26:22 AM
Comment:
The article is great in explaining the n-tier architecture, however, does not describe porting to just another server (how do I change the web.config file for a different server, what other considerations to take) and the grammar is really bad.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-19 5:27:20 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search