In-Depth

Mainsoft Overhauls .NET-to-Java Porting Tool

Mainsoft Corp.'s tool for porting .NET Web apps to Java gets major new upgrade.

Mainsoft Corp. recently released an upgrade of its tool for porting .NET Web and server apps to Java-compatible platforms.

The newly renamed Mainsoft for Java EE 2.0 now supports more current versions of Microsoft development tools and platforms, including Visual Studio 2005, .NET 2.0 and ASP.NET 2.0. The previous version, called Visual MainWin for J2EE, was only available for Visual Studio 2003 and .NET 1.1.

"It was a big leap, a really big leap," Mainsoft President Yaacov Cohen says of the latest upgrade of the company's $12 million project. "ASP.NET 2.0 was a much bigger move than the move to 1.1."

Comfort Zones
The tool allows developers experienced in building on Microsoft's platform to stay in their Visual Studio and .NET comfort zones while producing Web and server apps that run on Linux and other Java-based platforms. Mainsoft's technology in effect transforms C# and Visual Basic into programming languages for the Java Virtual Machine through cross-compilation software, the company says.

A developer can even debug an app running on a Java Virtual Machine from Visual Studio, says Cohen, who likens the enabling operation to open heart surgery. "We get the code from the Java VM [virtual machine] in Java code, but we dynamically evaluate the expression back into C# or VB.NET because that's what the developers want to see. The point is you end up with a single source code that can be compiled once on .NET and once on Java."

That's no small thing for enterprises looking to consolidate platforms or deploy in-house .NET apps to Linux machines, says Clay Ryder, president of the California technology research and consulting firm The Sageza Group Inc.

"If you move everything to Linux and say to the developers, 'Now guys, you have to learn this,' their productivity is going to be a lot lower for a while. They're going to have to be re-trained, and they're not going to be as effective," Ryder says. "You can avoid that productivity hit or space it out over time with a translation tool like this."

Cooperative Effort
The Mainsoft runtime was built in collaboration with Project Mono, an open source software effort launched in 2001 to port .NET to Linux, Unix and other non-Microsoft platforms. Mainsoft assigned 30 of its software engineers to contribute to the project, Cohen says.

The Sageza Group's Ryder says well-written, high-level code often can execute correctly on the new platform straight from the Mainsoft translation tool, but older code, which typically is more tied to hardware, may require some manual tweaking. The .NET to Java port is typically straightforward, though, because both platforms are well insulated from hardware, he says.

"The .NET environment is different than NetBeans or other Java environments. However, that being said, since it's just software you can get the necessary class libraries to take a .NET app and run it through this tool and get the code you need to run it in a Java EE environment," Ryder says.

Ryder says Mainsoft has long been the dominant cross-platform portability tools vendor. "There are niche players at this," he adds, "but Mainsoft is certain one of the longer-established players in this space.

About the Author

Michael Desmond is an editor and writer for 1105 Media's Enterprise Computing Group.