Review: Write C# and Run on J2EE? Believe It with Visual MainWin

Review: Write C# and Run on J2EE? Believe It with Visual MainWin

hen it comes to app server platforms, people can?and do?debate endlessly about which is the best for running enterprise-class applications. Is it the Microsoft .NET platform? Or one of many application servers that implement the J2EE specification, such as BEA WebLogic 8.1? Each camp has unique advantages, but, as run-time platforms, features and performance are only part of the picture. To make a wise, strategic decision, a software team needs to consider other factors as well.

Chief among these is ease of development and deployment. Microsoft has always dominated this category; Visual Studio and Visual Studio.NET are widely used tools?and with good reason. They provide a very low learning curve and brilliantly abstract away the complexities of deployment and debugging. With Visual Studio even junior developers can start building enterprise-class applications without fretting over infrastructure issues.

Recently the development tools in the Java/J2EE space have begun to catch up. In particular BEA WebLogic Workshop 8.1 approaches Visual Studio.NET in terms of simplicity?and may even surpass it. Eclipse is also popular?and extremely powerful?but has a high learning curve. Sun’s Java Studio Creator (nee Project Rave) is showing some exciting potential too.

Mainsoft has thrown its hat into the ring with a revolutionary approach. Its product, Visual MainWin, gives the best of both worlds. Using Microsoft Visual Studio.NET and C#, you can build, deploy, and even debug applications on a variety of J2EE application servers. Yes, that is right: You can compile C# or VB.NET from VS.NET into java bytecode and run it on J2EE.

Currently Visual MainWin supports Tomcat, BEA WebLogic, and IBM WebSphere, with more to follow, most notably JBoss.

This original approach opens up some very interesting possibilities and offers companies unique platform flexibility. For example, if a company decides it isn’t happy with the Microsoft.NET platform, it can move to J2EE without retraining developers, hiring new developers, or rewriting apps. C# and VB.NET developers can hit the ground running!

Installation and Starting New Projects
Installing Visual MainWin is very simple as everything is prepacked for you in an InstallShield installer. The wizard handles everything for you except for one thing: you have to tell it which application server you want to install this copy of Visual MainWin for. Be warned: If you want to develop for a different application server later you’ll have to uninstall Visual MainWin and reinstall it.

Figure 1. Picking an App Server: The installation dialog requires you to select which application server you want.

Your application server must be up and running before you do this step, or Visual MainWin will not be able to configure itself. The available options are to install the version of Tomcat 5 that is bundled with the software, use an existing Tomcat 5.0 installation, IBM WebSphere 5.1, or BEA WebLogic 8.1. For this review I used WebLogic 8.1.

Visual MainWin runs entirely inside of Visual Studio. So, to launch it, simply launch Visual Studio.NET. When you do, you’ll notice immediately that you have two new project types to choose from in the New Project dialog: C# for J2EE and VB for J2EE. For the purposes of this review I concentrated on C#, but a few simple applications written in VB.NET worked smoothly too.

The product is very tightly integrated with Visual Studio. To create a J2EE application, simply select File->New Project and pick the type of project that you want. As it does with traditional Microsoft applications, the New Project Wizard takes you through the intended solution type, abstracting the methodology for the solution type away from you.

Visual MainWin is designed from the ground up to be familiar to Microsoft developers in that you concentrate on the type of application that you want to build, not the type of infrastructure. For example, when you create a C# Web service, you are actually creating a DLL, but Visual Studio calls it an ASP.NET Web service and hides the plumbing from you. Visual MainWin does the same: It leads you to create (for example) a Web service, without making decisions about how the Web service is implemented on the underlying application server platform.

And because the paradigm for Visual MainWin follows the Microsoft one very closely, you will notice that the dialog does not give the option to create something that is J2EE or Java-specific such as an EJB. The underlying framework of your application is determined for you by Visual MainWin. For example, a Web application is implemented as an ASPX page, which compiles into a JSP under the hood. Mainsoft promise that future versions of the software will support EJB but how it will be supported is not yet clear.

Creating and deploying a Web service with Visual MainWin is just as simple as it is with Visual Studio.NET. If you are familiar with selecting the ASP.NET Web Services Wizard in the C# folder on the New Project Dialog, you will see that the process is almost identical?you simply select the ASP.NET Web Services Wizard in the ‘Visual MainWin C# for J2EE’ folder. Following the Wizard will create the standard and familiar boilerplate Web service, which is exactly the same as the one that Visual Studio creates for C# users. It is a ‘Hello, World’ Web service, with a single Web method that echoes ‘Hello World’ back to the user. The Wizard comments this code out. I commented the code back in and started debugging. The application compiled, deployed to WebLogic, and ran.

Fizzled WSDL
Not everything was as solid as I’d hoped. Web services usually have a simple test harness that allows you to query their methods from a Web interface, but Visual MainWin has nothing but a simple screen telling you that the test page is not yet supported. It suggests that you query the WSDL by amending the URL with a ?wsdl at the end. This is an inconvenience, albeit a minor one.

Figure 2. Pick a Project: To create J2EE projects in Visual Studio, simply select one of the two new project types added to the New Project dialog when you installed Visual MainWin.

You can add this URL as a Web reference in Visual Studio.NET and consume it as you would any other Web service. This, too, worked seamlessly.

Here’s another problem I noticed: If you create a Web service in C# and deploy it to WebLogic, and then attempt to consume it within a WebLogic Workshop environment by creating a WebLogic control from the WSDL, it fails. WebLogic doesn’t recognize the WSDL. While this isn’t a typical use of Visual MainWin, it does hinder a potentially useful use case?that of orchestrating Web services in a WebLogic process project.

I also tried to consume the WSDL with the Oracle JDeveloper stub/skeleton wizard, and it, too, failed to consume it. Microsoft Visual Studio, however, has no problem consuming the WSDL to create a Web service stub.

It seems that Web Services created using Visual MainWin are easily consumed by Microsoft .NET Clients, but not so easily consumed by Java-based clients.

The online documentation is very good and contains a number of detailed examples of large-scale applications that can be built using Visual MainWin. Some simpler, smaller scale examples would be useful as well, but what is there allows you to see the entire scope of the application. While Visual MainWin is not capable of generating EJBs, it is capable of consuming them, and examples of this are shown.

While generating EJBs may seem to be important functionality missing from the product, in fact, Visual MainWin is not designed to be used by senior architects?the people who build the frameworks on which your applications run and who can dream in EJB. But if these senior architects drive infrastructure in the direction of EJB, the development support team must follow suit. By leveraging Visual Studio’s ease of use, Visual MainWin delivers the ability for supporting developers to keep pace with the architectural vision, whatever that is and levels the playing field for Java in terms of complexity. The philosophy is that elite developers will continue to develop in what they see fit to use, and the lower-end developers will have this tool to make their work easier.

When it comes to database support, if your database is Microsoft SQL Server or Oracle, then your ADO.NET code will work without modification. If, however, you use any other database (for example MySQL or DB2), the process is a little more complex. Namely you have to import the JAR file for the JDBC drivers and explicitly use it and the relevant java.sql files to access the data. You end up effectively writing Java code in the C# environment. This isn’t as difficult as it sounds, but does negate some of the advantages of the platform.

Visual MainWin is an excellent and revolutionary product. While it has its flaws, they are relatively minor and most of them will be addressed in future versions according Mainsoft. For any company that wants to provide its services on Microsoft and J2EE-based platforms, it could provide a massive cost-savings. Having code that can run on both platforms and be debugged on both platforms is an enormous luxury. At $5,000 per workstation it may seem expensive, but a week’s worth of training for developers could easily cost as much.

If your developers are experienced in C# and you want the option of using J2EE application servers, Visual MainWin is uniquely qualified to help you. Don’t expect it to handle all of your code transparently, though. It should allow the majority of your code to run on a J2EE application server, which in itself is a major boon. Should Mainsoft continue to evolve the platform, widening its support for application servers, databases, and functionality the product will become a must-have for everybody.

Editor’s Note: Laurence Moroney is currently the Director of Product Evangelism at Mainsoft; however, he wrote this article for DevX before joining Mainsoft.
devx-admin

devx-admin

Share the Post:
USA Companies

Top Software Development Companies in USA

Navigating the tech landscape to find the right partner is crucial yet challenging. This article offers a comparative glimpse into the top software development companies

Software Development

Top Software Development Companies

Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in

India Web Development

Top Web Development Companies in India

In the digital race, the right web development partner is your winning edge. Dive into our curated list of top web development companies in India,

USA Web Development

Top Web Development Companies in USA

Looking for the best web development companies in the USA? We’ve got you covered! Check out our top 10 picks to find the right partner

Clean Energy Adoption

Inside Michigan’s Clean Energy Revolution

Democratic state legislators in Michigan continue to discuss and debate clean energy legislation in the hopes of establishing a comprehensive clean energy strategy for the

Chips Act Revolution

European Chips Act: What is it?

In response to the intensifying worldwide technology competition, Europe has unveiled the long-awaited European Chips Act. This daring legislative proposal aims to fortify Europe’s semiconductor

USA Companies

Top Software Development Companies in USA

Navigating the tech landscape to find the right partner is crucial yet challenging. This article offers a comparative glimpse into the top software development companies in the USA. Through a

Software Development

Top Software Development Companies

Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in and explore the leaders in

India Web Development

Top Web Development Companies in India

In the digital race, the right web development partner is your winning edge. Dive into our curated list of top web development companies in India, and kickstart your journey to

USA Web Development

Top Web Development Companies in USA

Looking for the best web development companies in the USA? We’ve got you covered! Check out our top 10 picks to find the right partner for your online project. Your

Clean Energy Adoption

Inside Michigan’s Clean Energy Revolution

Democratic state legislators in Michigan continue to discuss and debate clean energy legislation in the hopes of establishing a comprehensive clean energy strategy for the state. A Senate committee meeting

Chips Act Revolution

European Chips Act: What is it?

In response to the intensifying worldwide technology competition, Europe has unveiled the long-awaited European Chips Act. This daring legislative proposal aims to fortify Europe’s semiconductor supply chain and enhance its

Revolutionized Low-Code

You Should Use Low-Code Platforms for Apps

As the demand for rapid software development increases, low-code platforms have emerged as a popular choice among developers for their ability to build applications with minimal coding. These platforms not

Cybersecurity Strategy

Five Powerful Strategies to Bolster Your Cybersecurity

In today’s increasingly digital landscape, businesses of all sizes must prioritize cyber security measures to defend against potential dangers. Cyber security professionals suggest five simple technological strategies to help companies

Global Layoffs

Tech Layoffs Are Getting Worse Globally

Since the start of 2023, the global technology sector has experienced a significant rise in layoffs, with over 236,000 workers being let go by 1,019 tech firms, as per data

Huawei Electric Dazzle

Huawei Dazzles with Electric Vehicles and Wireless Earbuds

During a prominent unveiling event, Huawei, the Chinese telecommunications powerhouse, kept quiet about its enigmatic new 5G phone and alleged cutting-edge chip development. Instead, Huawei astounded the audience by presenting

Cybersecurity Banking Revolution

Digital Banking Needs Cybersecurity

The banking, financial, and insurance (BFSI) sectors are pioneers in digital transformation, using web applications and application programming interfaces (APIs) to provide seamless services to customers around the world. Rising

FinTech Leadership

Terry Clune’s Fintech Empire

Over the past 30 years, Terry Clune has built a remarkable business empire, with CluneTech at the helm. The CEO and Founder has successfully created eight fintech firms, attracting renowned

The Role Of AI Within A Web Design Agency?

In the digital age, the role of Artificial Intelligence (AI) in web design is rapidly evolving, transitioning from a futuristic concept to practical tools used in design, coding, content writing

Generative AI Revolution

Is Generative AI the Next Internet?

The increasing demand for Generative AI models has led to a surge in its adoption across diverse sectors, with healthcare, automotive, and financial services being among the top beneficiaries. These

Microsoft Laptop

The New Surface Laptop Studio 2 Is Nuts

The Surface Laptop Studio 2 is a dynamic and robust all-in-one laptop designed for creators and professionals alike. It features a 14.4″ touchscreen and a cutting-edge design that is over

5G Innovations

GPU-Accelerated 5G in Japan

NTT DOCOMO, a global telecommunications giant, is set to break new ground in the industry as it prepares to launch a GPU-accelerated 5G network in Japan. This innovative approach will

AI Ethics

AI Journalism: Balancing Integrity and Innovation

An op-ed, produced using Microsoft’s Bing Chat AI software, recently appeared in the St. Louis Post-Dispatch, discussing the potential concerns surrounding the employment of artificial intelligence (AI) in journalism. These

Savings Extravaganza

Big Deal Days Extravaganza

The highly awaited Big Deal Days event for October 2023 is nearly here, scheduled for the 10th and 11th. Similar to the previous year, this autumn sale has already created

Cisco Splunk Deal

Cisco Splunk Deal Sparks Tech Acquisition Frenzy

Cisco’s recent massive purchase of Splunk, an AI-powered cybersecurity firm, for $28 billion signals a potential boost in tech deals after a year of subdued mergers and acquisitions in the

Iran Drone Expansion

Iran’s Jet-Propelled Drone Reshapes Power Balance

Iran has recently unveiled a jet-propelled variant of its Shahed series drone, marking a significant advancement in the nation’s drone technology. The new drone is poised to reshape the regional

Solar Geoengineering

Did the Overshoot Commission Shoot Down Geoengineering?

The Overshoot Commission has recently released a comprehensive report that discusses the controversial topic of Solar Geoengineering, also known as Solar Radiation Modification (SRM). The Commission’s primary objective is to

Remote Learning

Revolutionizing Remote Learning for Success

School districts are preparing to reveal a substantial technological upgrade designed to significantly improve remote learning experiences for both educators and students amid the ongoing pandemic. This major investment, which

Revolutionary SABERS Transforming

SABERS Batteries Transforming Industries

Scientists John Connell and Yi Lin from NASA’s Solid-state Architecture Batteries for Enhanced Rechargeability and Safety (SABERS) project are working on experimental solid-state battery packs that could dramatically change the

Build a Website

How Much Does It Cost to Build a Website?

Are you wondering how much it costs to build a website? The approximated cost is based on several factors, including which add-ons and platforms you choose. For example, a self-hosted