This article may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. To maintain the flow of the article, we've left these URLs in the text, but disabled the links.


MIND


MIND Editor's Note

You know , the pace of this industry is staggering. Back in the Summer 1996 issue of MIND, we were talking about the upcoming release of Visual J++ 1.0. And now, we're already looking at version 6.0 of the product! In less than two years, we've been through five versions! Even we can't keep up. We think we missed a few of the versions in between, but we promise to try harder in the future.
      So let's just wipe the slate clean and start with Visual J++ 6.0. We recently received copies of the Technology Preview version. It's actually quite an amazing product, and shows just how far Microsoft has come in making Java more useful for programmers. You'll be hearing a lot about the Windows Foundation Classes (WFC) in the near future, so we thought it might be a good idea to give you an update on what's going on.
      In a poll we just made up, 82 percent of all Java users who identify themselves as "pure Java" aficionados are "crabby" that Microsoft has offered them a version of Java that's easier to use and more powerful on Windows-based machines than "pure Java" could ever be. The problem isn't that Microsoft is making Windows-centric extensions to Java. After all, Sun is doing the same thing with its Java 3D extensions and you don't hear anyone complaining. The problem, at least in the eyes of "pure Java" fans, is that Microsoft is making a compelling case that the benefits of the Windows operating system outweigh the gains you'd get by making your Java program run on both Windows platforms and Solaris.
       Fortunately, Visual J++ 6.0 solves this problem while accommodating both camps. If you have to write strictly "pure" Java code, aimed at the lowest common denominator of each target system, Visual J++ 6.0 does give you that option through a simple checkbox setting. If, however, you want to get into some really amazing stuff, the newly minted WFC is really for you.
      If you've used C/C++ this decade, you've probably encountered MFC, which encapsulates Win32 base functions in an easy-to-use way. WFC takes things one step further by combining Win32 and DHTML in an orgy of Internet-osity. (If you're a regular reader of this mag—and hey, who isn't?—you've seen our coverage of Dynamic HTML over the past year. DHTML not only represents an incredible leap in Web-based functionality, but it's fun to play around with as well.) Depending on which libraries you import, you can use nearly identical code that generates either a Windows-based or browser-hosted application.
      You can do a lot more stuff with WFC as well. Not only do you get your choice of UI, salad, and beverage, you also get simplified graphical functions, client or server-side execution of operations, MS-DOS command-line operation, and mix-and-matchability. Using Win32 functions is best in some situations. When you need custom solutions, you might have a COM interface you need to call. Heck, you might even have a thing for DHTML event bubbling. With WFC you can mix all three—Win32, COM, and DHTML—in the same coding namespace.
      You can also use WFC to write one module that's compatible with both ASP and HTML. You even get a unified event model—you can target either DHTML or Win32 events all without breaking a sweat. In the Technology Preview version, you would write a single function called onClick, then do this to target Win32


 import wfc.ui.*;
 . . .
 
 button1.addOnClick( new EventHandler(this.onClick));
or this for DHTML:

 import wfc.html.*;
 . . .
 
 button1.addOnClick(new DhEventHandler(this.onClick));
      Come on. What could be easier? We'll have extensive coverage of Visual J++ in the months to come, so watch this space for more info. Meanwhile, cruise on over to the Visual J++ home page (http://www.microsoft.com/visualj) for lots of fun details. And best of all, MSDN Snapshot CD you should have received with this issue has working copies of both Visual InterDev 6.0 and Visual J++ 6.0.
J.T.

From the May 1998 issue of Microsoft Internet Developer