|
YOUR FEEDBACK
|
TOP MICROSOFT .NET LINKS ASP.NET Interop Update: A Fast Track to Rehost Your .NET Applications
Double your market reach by running .NET Web and server apps on Java-enabled platforms
By: Laurence Moroney
May. 2, 2006 10:30 AM
You already know the sheer productivity advantages of developing applications that run on the .NET framework using the Visual Studio.NET IDE, and have likely developed and deployed one or more of these in the years since they became generally available. But did you know that you can double your market reach for .NET Web and server applications by rehosting them, without major modifications, to run on Java-enabled platforms such as WebSphere running on Linux? According to Forrester Research, J2EE is used by 56 percent of financial services and insurance companies, and by 44 percent of the overall market.
Composite Application Platform on IBM WebSphere Application Server The Above All Composite Application Platform, whose architecture is shown in Figure 1, can expose existing applications and systems with an SOA-enabled interface, manage the integration of applications including manag-ing the runtime and the service repository, and provide a visual front end that allows services to be tied together into a business application. "We didn't think it would be cost effective to rewrite our deployment servers, which consists of 260,000 lines of C# code, in Java," said Deborah Scharfetter, vice president of products for Above All Software. "The development team estimated it would have taken 12-15 months to complete the rewrite, and they would have had to incur significant ongoing costs to support multiple source code bases and deployment types." Typically, if one rewrote their application to Java, or ported it by hand, then future bug fixes and product enhancements would have to be implemented on two separate code bases - the .NET one and the Java one. This would drastically increase the costs associated with the application, requiring separate teams with separate skill sets, and a project management nightmare in keeping schedules of separate teams synchronized. Instead, Above All opted to rehost the application on WebSphere using Mainsoft's Visual MainWin for J2EE. "Mainsoft delivered a version of their platform running natively on J2EE in 3 months, saving the company an estimated $1million in development costs," added Scharfetter. Mainsoft also helped Above All establish a single source code development environment. With a single-source code approach to application development, the software vendor's development team is able to focus on what they do best - growing the capabilities of their platform using the .NET framework and Visual Studio .NET development technologies.
How Does the Enabling Technology Work? This is achieved by using a plug-in for the Visual Studio .NET IDE. This plug-in gives you new project types that will invoke this compiler and recompile your MSIL into Java Byte code. You can see this in Figure 2. It also implements a 'Generate J2EE Project' wizard that creates a new version of the project file that contains your source code. It does this to give you a single source code solution. Your aspx, asmx, ascx files and their code behind don't get cloned into different versions for your J2EE project. Instead, a separate project which uses the same source files gets created. This project is configured to invoke the J2EE compiler and perform the Byte code level translation. Another powerful aspect of rehosting your .NET code to run on a JVM is the fact that you can interact directly with assets that you may have hosted on the Java platform. Thus it provides an interoperability solution. So, if for example you have EJB assets on a J2EE server, and an ASP.NET front end that consumes them, you will likely go through a middleware layer whereby the EJBs are wrapped in Web services, or a bridging middleware solution. These would then get consumed by your ASP.NET front end. To get the front end to talk to the EJBs, you thus have to introduce a new transport layer just so that the technologies can talk to each other. If your ASP.NET code is rehosted to run on J2EE, this is no longer necessary, as it can consume the Java assets directly. The runtime architecture, termed a unified platform architecture looks like Figure 3. Under this architecture your C# or VB.NET application code which runs on the .NET framework namespaces such as System.Web and System.XML gets implemented using the standard Java packages 'under the hood'. For example, if your application uses System.Data, and by extension ADO.NET, the translator will convert this into Java Byte code that uses the Java-translated System.Data namespace, which in turn uses JDBC to execute on the JVM.
How-to Guide: Moving Towards Multi-Platform Solutions This application implements basic online shopping tasks including: a product catalog, user authentication and personalization, shopping baskets and order checkout. Designed after traditional distributed Web applications, the Commerce Starter Kit is built across three logical tiers. These are:
If you download the Visual Studio.NET version of this application, you'll get a solution that contains a single project called CommerceCSVS. Next, if you haven't done so already, download the free developer edition of Visual MainWin for J2EE from Mainsoft's developer zone at http://dev.mainsoft.com. Once you have installed this, open the CommerceCSVS solution. In Solution Explorer, right click on the project, and you'll see a menu option 'Generate J2EE Project'. This will launch a wizard that you can use to step through constructing the J2EE port of your project. The Tomcat application server comes bundled with the developer edition of Visual MainWin for J2EE, so you can safely use that here. The Enterprise edition of the software expands to allow applications to be ported to, or created originally on, WebSphere, BEA WebLogic or JBoss. To get your application to run on J2EE, you only need to do one change - by default the database connection string is configured to use SSPI security, which isn't supported by JDBC. You simply have to change this to provide a user name and password instead. You'll find the connection string in your web.config file, and details for the user name and password with the Commerce Starter Kit documentation. When you run it, it will automatically deploy to your local Tomcat, and execute it there. You can see it running in Tomcat in Figure 5. Not all ports will be as easy as this one, where no code needed to be changed, other than the configuration string for database access. There are scenarios where a direct crossover between .NET and Java does not exist, for example if you are using case insensitive path names. Windows is much more forgiving of this than Unix, and as such Java is case sensitive in this area, so any strings or string resources that you use should be made case sensitive so that the Java version of your application can happily use them.
Conclusion Additional benefits of this approach are also made possible - reducing complexity in connecting different systems for one. Expensive bridging or web services layers are no longer necessary to connect your ASP.NET front ends to your Java-based back ends. Also, management, deployment, maintenance of large data centers can be drastically simplified by targeting a single runtime platform instead of diverse ones. YOUR FEEDBACK
MICROSOFT .NET LATEST STORIES
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK BREAKING NEWS FROM THE WIRES
|
|||||||||||||||||||||||||||||||||||||