This article details how to make a legacy code base more maintainable by utilizing a JSON architecture.
Every application at one point is challenged with a re-architecture to a more robust technology. While some are fortunate enough to rewrite their software entirely—updating the core language that the application is built on, most are tasked to do more with less. The approach that we took at Cayen Systems to give our app a face lift included utilizing JQuery with other client side technologies, while still preserving the classic ASP foundation.
Our JQuery modernization can be described in two parts: the first is an overhaul of the UI, and the second is a refactoring of how the pages communicate with one another. I will not go into too much detail on how we modernized our code base using jQueryUI, since there are a plethora of available resources that can help a developer utilize this technology. Instead, the focus of this article will be on page architecture using jQuery and JSON with some exposure to our jQueryUI implementation.
As you read this article, if you have any questions about implementation, feel free to reference the demo project. All snippets referenced below can be found in the sandbox archive attached to the article.
The module itself should be relatively simply. Since it does not contain either the load or save functions, in most cases it will consist of little to no server side code. One thing to note, in the example below I chose to directly access the JSON object from the parent. I went with this approach because of its simplicity, however in some cases it might make more sense to move the JSON object between pages via querystring.
The coolest part of this design is the isolation of the legacy code. With the exception of the AJAX page, all the code in this design is written with current industry standards, making it easier for the code to transition to newer technology—such as MVC & Razor.
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.
This is a really concise article for implementing JSON and jQuery in legacy applications.
You should add a download link to the top of the article. Even though the code is browsable using the second tab, downloading the code is much easier with the link.
Added the download link. Thanks for feedback.