Visual MainWin offers best of .Net, Java

When I first heard about Mainsoft's Visual MainWin for J2EE, I thought the concept was a harebrained idea. Just skimming some of the product's help topics sent me reeling: "Developing ASP .Net applications on J2EE." Give me a break.

Experimenting with the product put my sarcasm through a cleansing acid bath: If Visual MainWin for J2EE is a harebrained idea, it is the best-executed harebrained idea I've seen.

In a nutshell, Visual MainWin turns .Net applications into Java applications. But Visual MainWin for J2EE allows you to build ASP .Net apps -- ones that use ADO (ActiveX Data Objects) .Net -- and convert them to J2EE apps, deploy them to and debug them on J2EE app servers, and do it all from within Visual Studio .Net.

Visual MainWin for J2EE installs as a plug-in to the Visual Studio .Net IDE (integrated development environment). It also installs the included Tomcat 5.0 application server, which becomes the test bed for ASP .Net apps transformed into J2EE apps.

The word seamless has become nearly meaningless, but Visual MainWin's integration into Visual Studio deserves the label. Visual MainWin attaches itself to the output of the compilation process and translates the IL (intermediate language) code coming out of Visual Studio into the equivalent Java bytecode. It packages the code into the proper archive file, depending on the target app server, and deploys the archive to the app server, along with Java versions of the ASP .Net and ADO .Net libraries.

Thus, MainWin turns Visual Studio .Net into a "develop, debug, and deploy" IDE for J2EE apps, with the peculiar twist that those apps can be written in VB (Visual Basic) .Net or C#.

Aside from the Visual MainWin project templates added to Visual Studio, you hardly know Visual MainWin is there. You can use all the server-side controls from ASP .Net. ADO .Net is implemented on top of JDBC, and the latest release of Visual MainWin provides a generic database connection.

What's even more amazing is that the product wires the bytecode back to the .Net source for debugging purposes; you can single-step through C# or VB .Net source as Java bytecode executes. Not only is the translator converting IL code to bytecode, it's preserving the debug information -- an unexpected plus.

Visual MainWin does its best to map .Net entities to Java equivalents but must sometimes make exceptions -- for example, in the case of exceptions. Java provides one exception class, but .Net provides three; Visual MainWin is forced to map all three .Net exceptions to the single Java exception. There's no easy fix; you simply have to write around this many-to-one mapping.

Although all .Net exceptions are derived from the System.Exception class, not all Java exceptions are derived from java.lang.Exceptions; some generated by the JVM (Java Virtual Machine) are derived from the java.lang.Error class. This incongruence shows up in .Net code that tries to catch all exceptions. When translated into Java, exceptions derived from java.lang.Error slip by.

This is where Visual MainWin's conditional compilation constants -- JAVA and NET -- come in handy. JAVA is true when the output of compilation is Java bytecode, and NET is true when the output is Microsoft IL. Use of these compilation constants allows you to create platform-agnostic source code. You can even import EJB references into a .Net project and call EJBs from VB .Net or C# code with Mainsoft-supplied wrapper code.

Visual MainWin for J2EE is remarkable; it is clever and smooth, and the exception-related write-arounds are but minor annoyances. At the very least, this opens the world of Linux to ASP .Net apps, and those results will be very interesting to watch.

Join the newsletter!

Error: Please check your email address.
Rocket to Success - Your 10 Tips for Smarter ERP System Selection
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Rick Grehan

Show Comments

Most Popular Reviews

Latest Articles


PCW Evaluation Team

Sarah Ieroianni

Brother QL-820NWB Professional Label Printer

The print quality also does not disappoint, it’s clear, bold, doesn’t smudge and the text is perfectly sized.

Ratchada Dunn

Sharp PN-40TC1 Huddle Board

The Huddle Board’s built in program; Sharp Touch Viewing software allows us to easily manipulate and edit our documents (jpegs and PDFs) all at the same time on the dashboard.

George Khoury

Sharp PN-40TC1 Huddle Board

The biggest perks for me would be that it comes with easy to use and comprehensive programs that make the collaboration process a whole lot more intuitive and organic

David Coyle

Brother PocketJet PJ-773 A4 Portable Thermal Printer

I rate the printer as a 5 out of 5 stars as it has been able to fit seamlessly into my busy and mobile lifestyle.

Kurt Hegetschweiler

Brother PocketJet PJ-773 A4 Portable Thermal Printer

It’s perfect for mobile workers. Just take it out — it’s small enough to sit anywhere — turn it on, load a sheet of paper, and start printing.

Matthew Stivala

HP OfficeJet 250 Mobile Printer

The HP OfficeJet 250 Mobile Printer is a great device that fits perfectly into my fast paced and mobile lifestyle. My first impression of the printer itself was how incredibly compact and sleek the device was.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?