Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Improving Maintainability of Legacy Code With a JSON Architecture

, , 31 May 2012
This article details how to make a legacy code base more maintainable by utilizing a JSON architecture.
<%@Language="VBScript" CodePage="65001" %>
<%Option Explicit %>
<script language="JScript" runat="server" src='javascript/json2.js'></script>
<!-- #include file="include/JSON_2.0.4.asp" -->
<%
Dim Action

Action = Request("Action")

Select Case Action
	Case "Load" Load()
	Case "Save" Save()
	Case Else Response.Write("Unknown Request")
End Select

Sub Load()
	Dim ID
	Dim JSONData

	Set JSONData = jsObject()

	'Replace these lines with database access code
	JSONData("firstname") = Session("FirstName")
	JSONData("lastname") = Session("LastName")

	Response.Write(JSONData.jsString())
End Sub

Sub Save()
	Dim JSONData
	
	Set JSONData = JSON.Parse(Request.Form("JSON"))
	
	'Replace these lines with database access code
	Session("FirstName") = JSONData.firstname
	Session("LastName") = JSONData.lastname
End Sub
%>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Authors

rcarlson-cayen
Team Leader Cayen Systems
United States United States
No Biography provided
Group type: Organisation

1 members


Cayen Systems
Cayen Systems
United States United States
Cayen Systems develops online data management software for non-profit and education organizations with a team of experienced and dedicated individuals located in Milwaukee, Wisconsin. We provide the most comprehensive software solutions for information management, tracking and data reporting available today. Specializing in developing easy to use and efficient solutions, we consistently help our clients increase their productivity and reduce the costs of program management.
Group type: Organisation

23 members


| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 31 May 2012
Article Copyright 2012 by rcarlson-cayen, Cayen Systems
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid