Migrating from ASP to ASP.NET Breafly







Migration from ASP to ASP.NET can drastically improve the performance of your applications. A software created using ASP.NET is more robust, scalable, reliable, and secure as compared to the software created using ASP. ASP.NET, which is a new version of ASP, removes all the shortcomings of ASP. For example, it removes tier confusion from the code (by providing an easy way to separate presentation layer, business logic layer, and database layer), it allows code compilation instead of code interpretation, and provides CLR (Common Language Runtime) for built in garbage collection to avoid memory leaks.
ASP.NET, which uses .NET Framework, enables you to build globally distributed applications with Internet functionality and interoperability built into them. ASP.NET enables you to build platform independent software that can be easily integrated with any application developed on any platform and language that supports CLR. The .NET platforms now support approximately 25 .NET compatible languages as compared to ASP, which can support only two scripting languages -- VBScript and JavaScript.
ASP to ASP.NET migration can open a whole new world of possibilities for your web-based applications. For example, you can make use of already existing XML web services in your code to add a new feature or functionality to your code. XML Web services can be utility programs created by any developer and can be made available through Internet world wide without worrying about the operating system and programming language used to create them. Consider a situation where you want to validate the credit card number of your online customers on your website. Instead of writing the code to validate the credit card numbers of the customers yourself, you can simply plug in the already available Web service providing credit card validation in your code.
In addition, the ASP.NET migration can make the code of your application considerably small, easily manageable, and easily deployable. This white paper discusses the benefits that you may get, after the migration of your application from ASP to ASP.NET. It provides all the valuable information in understanding the important aspects of migration from ASP to ASP.NET and provides a clear insight into the benefits of proposed migration. This paper will help you understand the complexities of a migration and explain how to enable a smooth .NET migration of your ASP code. Furthermore this paper discusses the issues that you must consider before considering a migration and the various migration strategies available.

Benefits of ASP to ASP.NET Migration
Microsoft's .NET Framework is rapidly gaining momentum as a standard for business systems, both within an organization and for the external clients of an organization. The advantages of migration of your existing applications to ASP.NET are enormous and disadvantages are none. This is because all the features of asp are available in ASP.NET. Installing ASP.NET does not break your existing ASP applications. ASP.NET uses a separate file name extension (.aspx instead of .asp), separate configuration settings, and an entirely separate runtime technology. With an ASP application entire web server may go down if one application crashes but ASP.NET processes run in a different server space and in separate application domain. This saves entire web server to crash just because of one application. If ASP and ASP.NET are installed on the same computer, ASP pages and applications can continue to use the existing ASP engine, with no interference from ASP.NET.
Some other benefits of ASP to ASP.NET Migration are:
  • Better Language Support: ASP.NET is platform independent technology and supports 25 .NET languages such as C#, VB.NET, and JavaScript. .NET Developers can visually create Web pages with the use of VB style drag drop feature in Visual Studio.NET IDE. They can use built in debugging, testing and deployment features of .NET platform for easy manageability of code. In addition developers can use over 4500 .NET framework classes that provides a number of controls for performance monitoring, logging, file upload, image generation, XML processing, data access, transactions, regular expressions, message queuing, SMTP mail and much more.
  • Event-Driven Programming: ASP.NET is an object oriented technology that supports event driven programming unlike ASP. Objects on a Web page can expose events that can be processed by ASP.NET code. Load, Click and Change events handled by code makes coding much simpler and better organized.
  • Improved Scalability: ASP.NET has removed the bottlenecks created by ASP sessions, which used to work well only on the server where they were created. They used to store the session data "in-process" on the web server, which was a cause of scalability bottlenecks on high-volume sites. ASP.NET stores session's data on a dedicated state server that can be easily shared by multiple web servers and on an SQL Server database too, providing a better scalability and availability of sessions. This has improved the server to server communication, making it possible to scale an application over several servers. One example of this is the ability to run XML parsers, XSL transformations and even resource hungry session objects on other servers.
  • Improved Performance: ASP.NET highly improves the performance of your code because it uses caching in code with automatic content expiration. This feature automatically expires and refreshes data from the cache. This automatically solves the problems of memory leaks from your application and improves the performance of your application. ASP.NET performs dynamic compiled execution of code, which allows fast retrieval of pages as compared to ASP, which requires each page to be interpreted when it is requested by the client. The dynamic compilation automatically detects changes in the code and stores the compiled code in memory to serve the future requests by the web server.
  • Easier Configuration and Deployment: ASP.NET use XML (extensible markup language) file within the application to store application configurations. The configuration files used by ASP.NET applications can be changed and uploaded while the application is running without restarting the server. The web applications are simply copied to the server without the need to run regsvr32 to register any application components and configuration settings.
  • Easier Code Maintenance: ASP.NET enables easy code maintenance because it separates presentation layer from business logic layer. Developers with relevant expertise in front end and back end programming can easily maintain code as compared to ASP, where a single file is used to write HTML, VB script, Java script, and ASP code.

Fundamental Changes in Code
Both ASP and ASP.NET can coexist with each other. ASP and ASP.NET applications can run side by side on a server without having adverse affect on each other. Both applications use separate file extensions, configuration models, and processing engines. For example an ASP application uses .asp extension and a .NET application uses .aspx extension. The configuration in ASP is done using registry but ASP.NET uses XML-based configuration files. You can have one part of an application running ASP and another part of the same application running ASP.NET. All these features are very beneficial if you need to move a large, rapidly changing site to ASP.NET one piece at a time.
The fundamental changes that may occur in the code after migration can be categorized into following categories:
  • Core API Changes: These changes refer to the changes made to the API method calls while migration. For example the changes that would occur when you make the calls related to Request, Response, and Server objects. Usually the method of making calls is same but if there are multiple values for a given key for collection objects different method to return the collection of values is used.
  • Structural Changes: These changes refer to the changes that affect the layout and coding style of an application. For example ASP.NET pages only support one language on a single page where as ASP allowed multiple languages to be used on a single page. ASP.NET page functions must be declared in <script runat=server> blocks where as in ASP, page functions are declared within <% %> blocks. In ASP.NET, page functions must be declared in <script runat=server> blocks whereas ASP.NET does not support page-render functions.
  • Visual Basic Language Changes: VB.NET is a complete programming language as compared to VB Script that was used in ASP. Some of the changes include the removed use of VARIANT data type and Option Explicit. The variable declared with VARIANT data type needs to be transformed to some basic data types. The Option Explicit is made a default feature. Some other keywords such as LET and SET are not supported and Integer values are now 32 bits and Long types have become 64 bits.
  • COM-Related Changes: VB.NET code migration does not force you to incorporate any COM-related changes in your code. Most of these changes are back stage changes and are done automatically. Some changes include the change in threading model, early binding and late binding changes, and changes in OnStartPage and OnEndPage methods in the code.
  • Application Configuration Changes: ASP.NET requires you to store all your configuration settings in Web.config file, which is available in the main application directory.
  • State Management Issues: ASP.NET does not require you to change your Session or Application objects. On the other hand it provides State Management Options for Inproc, StateServer, SqlServer for improved control on your applications. If your application is partially migrated to .NET platform then you cannot share state variables stored in the intrinsic Session or Application objects in your application with .NET pages. You need to duplicate this information in both systems, till the complete migration takes place.
  • Security-Related Changes: ASP.NET supports Windows, Passport, and Forms-based authentication, including cookie management and automatic redirecting of unauthorized logins. All these authentication methods were also available in ASP but Passport based authentication in a new feature added to ASP.NET. Unlike ASP, ASP.NET does not do per-request impersonation. It does not allow your code to run on behalf of authenticated user. You can still use your old authentication methods and perform custom user and login checking using other authentication methods.
  • Data Access: ASP.NET uses ADO .NET, which offers an enormous range of features as compared to ADO to improve your data access methods. It offers powerful new features to get you data from database. Though you need not make any code changes for migration but you can make use of all ADO.NET features in your code.

Migrating Existing Applications to ASP.NET
Although migration of your existing applications to ASP.Net can be very beneficial, sometimes people are reluctant to make this transition. This may be due to many reasons. One of ASP's great assets is that it allows you to use a very simple scripting language, which is not the case with .NET platform. .NET uses modern, full-featured programming languages. ASP.NET therefore places much greater demands on web developers, compared to those placed on conventional software developers.
In ASP, executing the principles of good design is extremely difficult. ASP applications are complex and difficult to maintain, with very low code re-use. On the other hand with .NET there is an opportunity to produce better-designed applications, with resulting benefits in sustaining the quality.
However these design skills are new demands on ASP programmers, and have a long and steep learning curve. While it is very much possible to write ASP.NET applications in the ASP style, this will reverse many of the advantages of .NET technology.
Developers who have not come from a traditional software development background may require more extensive training to adapt to the new concepts. Even experienced software developers may not have fully used object orientated features previously. There could be performance scaling down and productivity decline while developers get accustomed to .NET.

Facts to Consider Before Migration
Before you go for a migration you must determine the benefits that you expect from the migration and the time that you can afford to spare for the migration process. You must also understand the complexity of migration in your application. If you have a big application with number of modules, the quality of the code, the use of COM components, and the distribution of data access functions in the code are few important factors that must be considered before you go for migration.
The greatest difficulty in all programming is good design. If your code has a good design and the multi-tiered separation exists in your application code then the migration process can be smooth else the migration process will be complex and would require a huge amount of effort. A good code design implies that the presentation layer is separated from the business components layers and data access functions reside centrally in data tier.
Changing an ASP page's file extension from .asp to .aspx and correcting for some syntactical changes is usually enough to get an ASP page working as an ASP.NET page. Such an approach, although it can be completed quickly, does not take advantage of many of the new features of .NET, including ASP.NET Web controls, Microsoft ADO.NET, the Microsoft .NET Framework classes. It is better to follow a complete lifecycle of migration and evaluate the complexity of your code to provide the best ASP.NET migration solution for your ASP code.
Although the complete migration of a site in one go is possible, it is often better to use a modular approach. The decision to go for a modular migration or full fledged migration is based on the size and complexity of the application. The simple and small web sites can be migrated to .NET platform in one go but big, complex, and mission critical business applications should be migrated using a modular approach.

Migration Strategies
If a company is going to put forth the effort to move their software to ASP.NET platform then this migration may be a long-term investment for the company. This can be an opportunity to make as many architectural and design improvements as possible in the existing code. In such a scenario, a phased approach for migration is must, where both ASP and ASP.NET modules coexist, till complete migration takes place.
If a company is looking for long-term benefits from the migration then the company can follow the approaches given below:
Co-Existence
In this approach, you can have the ASP and ASP.NET modules existing together. You can perform migration for a specific functionality of an application and ensure that the migrated module would still interoperate with the existing application. At Hanu, we follow the following co-existence strategies:
  • Migrating Shared Pages: In this approach we select only those pages first that share their code with other pages. These pages are common pages having intensive code processing and the potential for caching. This enables the important and complete sections of the applications to be migrated first. After this migration both ASP and ASP.NET would be running simultaneously and ASP pages will be using ASP.NET code.
  • Migrating New Pages: In this approach we select only those pages, which need to be added to the application for additional functionality. These pages can be entirely new pages or existing pages that require major code changes. This is the most comfortable approach without affecting the existing functionality. This also restricts new bugs to the new pages only.
  • Migrating Entire Tier or Entire Module: In this approach, we either select an entire module for migration or migrate the application tier by tier. This can be done using Horizontal and Vertical migration strategies. Both these migration strategies will be discussed in the next section of this paper.
Build the Roadmap
In this approach, to get long term benefits of migration, you decide to invest in re-architecting a system so that you can make the best use of .NET framework. The primary objective of this approach is to provide a comprehensive and detailed design for future project developments.
Full Fledged
In this approach you may want a full fledged migration of your system with the plans for change in application design, development, and deployment. This may be due to some strategic business needs.
There are basically two co-existence migration strategies: Vertical and Horizontal Migration. Both of these strategies offer a modular approach for migration.

Vertical Migration
Vertical migration refers to migrating an application one tier at a time, as shown in the Figure given below. For example, consider you have a three tier HR application, which consist of three modules, Recruitment, Leaves Management, and Salary Management. The three tiers used by the application include the user interface, business components, and database.
Vertical migration approach would proceed through all the pages of the user interface tier for each module, followed by the business component and data interface tiers, as shown in the figure given below:

The vertical migration is most appropriate when the application's modules are tightly coupled and minimal changes are required to the interfaces between application tiers. The initial architectural review in this case could yield opportunities for shared code across all three tiers rather than result in separating the modules into distinct applications.

Horizontal Migration
Horizontal migration refers to migration of an application module by module, completing the migration for all three tiers of one module before moving on to the next. As shown in the Figure given below. For example Horizontal migration would proceed through entire Recruitment Module first with all the three tiers (user interface, business components, and database) migrating together for that module. After the recruitment module is completely migrated the other two modules Leaves Management, and Salary Management will be migrated.

A horizontal migration is most appropriate when application modules are loosely coupled and when interfacing between different application tiers is a tedious task. An architectural review all of the application's modules should be conducted before any module migration begins. This review should uncover opportunities for creating reusable code, and may lead to separating the modules into independent applications.

Migration Life Cycle
We believe that no tool currently available is capable of providing a smooth and complte migration process. Tools can be used for basic migration but advanced migration requirements of the code can only be fulfilled using manual intervention in code. The complete migration lifecycle consists of four main stages.
  • Analysis: At this stage, you analyze the existing code, and create a migration strategy. You should consider the scope of migration, the processes required for migration such as code modification and testing plans. At this stage you should also identify the .NET specific functionality that can be added to the application or can be replaced with ASP.NET functionality.
  • Conversion: At this stage, you perform the actual code conversion. Start developing and modifying modules for migration. You should also perform unit testing and peer reviews for the converted code.
  • Re-factoring: At this stage, you perform code optimization and design improvement. This stage can actually enable you to get long terms gains from the migration and can be helpful in drastically improving the performance of the application.
  • Testing: At this stage you should conduct functional and non-functional testing for the modules that have been successfully migrated.
The complete life cycle of the migration process ensures a smooth migration of your system from ASP to ASP.NET

About the Authors
The following Hanu Software Employees contributed to the development of this white paper
Manoj Srivastava - Practice Manager, having a tenacious IT experience, helps clients to develop business application to leverage .NET platform.
Amit Kataria - Consultant, Focuses on .NET development projects, Management Scholar from renowned Indian College.
About Hanu Software:
Hanu Software is a global IT consulting and services provider, with corporate business offices located in Princeton, New Jersey and engineering campuses located in Gurgaon, India. Founded in 2002, our firm is dedicated to developing effective outsourcing partnerships with clients in order to reduce their IT costs, improve process management and reduce time-to-market for new product ideas. We provide end-to-end software solutions in a variety of industry verticals, including publishing, finance, real estate, insurance, retail and others

4 comments:

Unknown said...

Got more useful details about asp to asp.net

Convert ASP to ASP.Net

rmouniak said...

this amazing blog,It is very good blog and useful for students
.Net Online Training Hyderabad

Disha Nail Heart said...

One of the greatest benefits of plunge nails is their life span. While acrylic nails will generally endure between half a month prior requiring a final detail at the salon, plunge nails can endure as long as about a month. Plunge nails additionally last Best Nails in Noida longer than gels. Despite the fact that gel nail treatments can be wonderful and durable, they can be hard on nails. Gel nail treatments can cause nail weakness, stripping and breaking, and rehashed use can build the gamble for skin malignant growth and untimely skin maturing on the hands.

betting id said...

//techtopicsbyme.blogspot.com/2016/09/plsql-variables.html

Post a Comment