Novell Home

Developer Tool First Look: Visual Studio Developers, Welcome to Linux!

Novell Cool Solutions: Feature
By Richard Smith

Digg This - Slashdot This

Posted: 21 Jul 2005
 

Richard Smith
Developer Content Manager
Novell, Inc

Okay, I stole the title from Mainsoft's web page for Grasshopper, their Visual Studio .NET plug-in that allows you to use Visual Studio .NET to build applications for any Java enabled platform, including Linux. I don't know about you, but that sounds pretty cool to me!

The debate over which is better for building web based applications and web services, .NET or Java, has often focused on the ease of developing .NET over Java. Most will admit that .NET has many excellent tools, where Java lacks some of the powerful, easy to use tools.

Now using Grasshopper (and Visual MainWin for J2EE, Enterprise edition if you need to deploy to an application server other than Tomcat) you can use the power of the .NET development tools and deploy to the more secure and robust Java application server platform. Grasshopper is a free download for Visual Studio .NET developers and Mainsoft provides an abundance of very good documentation to help you get up and running, fast. To illustrate one of these, I took their "Create your first Linux application with the Visual Studio .NET IDE in 10 minutes" tutorial to see just how easy it was.

Here are a few screen shots from my experience:

When you install Grasshopper you also get a pre-configured installation of Tomcat to ease the development process. Be sure to start Tomcat before creating your sample project. Mainsoft makes it easy by adding both a Start Tomcat and Stop Tomcat command to the Grasshopper Start Menu group. After Tomcat goes through its initialization you should see a screen similar to this:

The first difference I noticed after installing Grasshopper and launching Visual Studio .NET was that there were some new options for creating projects.

You now have options to create projects in either C# or VB for J2EE deployment. I chose to do the tutorial in C#.

The tutorial then takes you through the steps for setting up the presentation page for your project. Here is what that looked like:

Adding the data grid and the button are merely drag and drop operations in Visual Studio .NET and when you do so the IDE creates all of the necessary background code for those objects.

Your job is to then add the code to enable your application to make the calls to the web service used to populate the data grid. This code is executed in response to the click of the button on the form. Here is a screen shot of part of the code:

Once the code has been entered into the web-form code window you can build and start the application from the Visual Studio .NET. Here is the build window output for creating our application:

------ Build started: Project: WebApplication2, Configuration: Debug_Java .NET ------

Preparing resources...
Updating references...
Performing main compilation...

Build complete -- 0 errors, 0 warnings
Building satellite assemblies...
Updating java references...
Compiling Java...
****************************************************  
Visual MainWin for J2EE (Developer edition) compiler  
****************************************************  
Processing C:\Visual MainWin Projects\WebApplication2\bin\WebApplication2.dll...
Validating classes...
Processing ASP.NET pages...
Converting Global.asax...
Processing C:\Visual MainWin Projects\WebApplication2\assemblies\uzccfmu7.dll...
Validating classes...
Converting ASP.NET pages...
Processing c:\windows\microsoft.net\framework\v1.1.4322\Temporary ASP.NET Files\webapplication2\ce7465e5\246eb351\r7qi2zci.dll...
Validating classes...
Packing files...
Preparing to deploy...



---------------------- Done ----------------------

    Build: 1 succeeded, 0 failed, 0 skipped

After the build, your completed project is deployed to the configured Tomcat server and the page is launched. Here is what the finished application looks like once served up by Tomcat.

This is running on Windows directly out of the IDE.

To deploy the application on Linux you need to use the Deployment Packager option form Visual Studio .NET's Build menu to create a WAR file.

The WAR file that this outputs can be handled by Tomcat's management console and placed in the appropriate directories to enable Tomcat to execute your application.

So, who should care?

Well, quite obviously, Visual Studio .NET developers who want to have options regarding where and how to deploy their solutions. Most developers will agree that VS is a very good tool, although it does come with a price tag and you may or may not wish to pay the price.

If you are willing, a major advantage of using Visual MainWin is that it enables you to leverage the two most prominent web application/web services infrastructures using the same tool set and gives you the flexibility to support both. J2EE is recognized as the most robust and full-featured platform for the back-end services required for web applications and web services, while .NET provides a very strong user-interface platform.

Given the split in the industry over J2EE and .NET, you may find yourself with both as part of your IT structure. These tools provide you with an easy way to bridge the gap and simplify your development, deployment and support.

Conclusion

If you have Visual Studio .NET and have an interest in building applications that can be deployed on a J2EE platform, then grab Grasshopper and go through the tutorial. You'll find it and all of Mainsoft's documentation to be very thorough and complete.

We'll also be taking a closer look at the Mainsoft products in a future Cool Solutions for Developers article to give you a better understanding of how the tools work in a more detailed fashion.

Resources and Links


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell