Columns
VJ++ - helpful, but is WFC use confining?
- By Todd Zino
- June 26, 2001
It is no secret that Microsoft feels a threat from Java to the market dominance
of its Windows operating system. Be that as it may, the latest release of Visual J++ takes developers down a path
that not only increases the productivity of Windows- or Web-based client/server development, but brings Java closer
to Windows with promising native OS technologies. But native OS development can be a double-edged sword, as it
can impede some cross-platform strategies. In any case, the newly released Technology Preview 1 of Visual J++ is
a keen insight into the look and feel of the entire Visual Studio 6.0 Integrated Development Environment, of which
Microsoft will be releasing components throughout 1998.
Visual J++ 6.0
Microsoft Corp.
Redmond, Wash.
800-426-9400
|
Despite its beta status, the Visual J++ Technology Preview installs and runs smoothly, and it won't disturb an
existing Visual Studio 97 on the system. Be prepared to install the latest update of Internet Explorer 4.01 and
reboot twice, however. Online documentation will have to be installed separately -- and is far from complete --
but the help interface is now Web-style, akin to the developer's network and Visual Basic.
In fact, many aspects of the new Visual J++ interface resemble that of Visual Basic 5.0, which was widely considered
a superior development interface within most of the Visual Studio 97 suite. Gone is the simple three-tab card for
file view, class view and info view. Each of the helpful panels and toolboxes can be floated, docked, moved or
simply hidden from view. Wizards for deployment and initial component creation abound and show improved usability
that would serve even the seasoned Java veteran well. The two main development views for the actual classes are
a visual form canvas for placing and designing user interface elements, and a code pane for actual source code
editing (see screenshot). While both are amazingly acute and flexible, and support dragging and dropping of items
from various toolbars, switching between the two is not so intuitive.
WINDOWS FOUNDATION CLASSES
Perhaps the single most important enhancement to Visual J++ is Microsoft's new Windows Foundation Classes (WFC).
These class libraries sit atop the previously released J/Direct API, which was the first step toward bringing Java
closer to the native Win32 system. Not only do they provide the large extent of native Windows API calls, but the
system also includes a toolbox for all primary graphical user interface (GUI) components à la Visual Basic.
Moreover, J/Direct can be accessed directly with function calls that can be built with a visual browser of the
entire API.
These transitions are the first serious steps toward Java's viability as a serious language for Windows rapid
application development (RAD). Visual J++ offers new programmers a Windows development language that is more robust
and versatile than Visual Basic, yet easier, more secure and more thread-safe than C++. Of course, as noted before,
this is a double-edged sword for those Java developers who wish to maintain cross-platform integrity in their applications:
Any use of WFC will preclude them from doing so. However, there is also an HTML visual toolbox of GUI components
that can be deployed to HTML 3.2-compliant browsers, as well as to browsers supporting Microsoft's Dynamic HTML
on other platforms if more fancy client interface features are desired.
|
"IntelliSense" now resides in the VJ++ source code editor. A pop-up menu displays available
members, while a "to do" list tells developers of source code they need to fill in themselves. |
The development process is much more optimal for efficient code generation than its predecessor, Visual Studio
IDE. The object browser provides a quick and powerful interface to the methods and properties of any package on
the system. The class outline, by contrast, gives a tree-like view of all currently used or created classes in
the project; a simple mouse click allows for easy overriding and zooming to the code for the specified member.
It is very easy to subclass any existing library elements using this tool. A project explorer and document explorer
exist to keep the developer in touch with the big picture and to generate useful reference material to the project
as it is produced.
INTELLISENSE TECHNOLOGY
The classic problem with RAD tools for a language like Java is gracefully assisting the developers when they
must leave the safety of the visual canvas and brave actual code. A good interactive development environment (IDE)
will perform this guidance so that more experienced coders will not become alienated or frustrated when they wish
to hack right into the source. Visual J++ handles these tasks beautifully.
The so-called IntelliSense technology previously seen in Microsoft Office now resides in the source code editor
as well. This feature underlines syntax and common usage errors in red, and a right mouse click will invoke a context
menu for discovering and addressing the problem. Perhaps even more impressive is a pop-up menu that displays all
available members whenever a class name is typed in the code. This is a great timesaver and reference that does
not intrude too much (if you continue typing, the menu disappears instantaneously). A useful "to do"
list, which informs developers of all of the source code they might need to fill in themselves in order to make
the application fully functional, occupies the bottom pane.
The ease and versatility of Java deployment with Visual J++ is also much improved. With the WFC and J/Direct
fully integrated, projects can now be deployed as Windows .EXE applications. There is, of course, full support
for .CAB and .ZIP archives, which is ideal for distribution and client/server applications. ActiveX and DCOM components
can also be created and made available to other language tools.
Deploying to a Web server is not quite as simple and requires installation of additional Internet Information
Server plug-ins, assuming that this is the developer's choice of server. As Java's handling of threads and exceptions
is much simpler and more powerful than that of C++, so too is the new debugger that is able to trace and switch
among running threads and exceptions in order to nail down the intricacies that result from designing multithreaded
applications.
MIGRATION HICCUPS
Compatibility is offered abundantly by Visual J++, but migration is not. Older J++ projects (as well as pure
Java files in general) can be imported and run with no hiccups, but there is currently not a viable way to 'convert'
older Abstract Windowing Toolkit (java.awt.*) interfaces into native WFC canvases. On the other hand, the source
code generated by the wizards and forms canvas is surprisingly readable, making it easier to customize and edit
at will. Renaming of objects in the various explorer panes is immediately reflected in the canvas or code, and
vice versa. Users can copy and paste objects on the canvas, and the newly cloned components will be given unique
identifiers.
STEP IN THE RIGHT DIRECTION?
Visual J++ 6.0 has managed to resolve most of the issues users had with J++ 1.1 and Visual Studio 97, without
creating many new obstacles. The only potential problems with the new Java IDE exist on a purely idealistic level.
With all of the infamy arising from the "write once, run anywhere" slogan, and Sun's lawsuit against
Microsoft over use of the "100% Java-compatible" logo, many will see Visual J++ 6.0 as a further obstruction
to Java's success as a vendor-independent platform that transcends operating systems.
However, many would argue that the World Wide Web has already achieved this goal in most practical capacities,
and the aforementioned HTML client deployment can be cross-platform while vastly strengthening Java's potential
on the server-side -- provided one uses Windows NT as the server. All of this is further shadowed by the reality
that most business and Internet applications are run and developed on Windows 95 and NT in today's real world.
The advent of Visual J++ 6.0 is a strategic step in the right direction for all involved. Newer developers whose
introduction to programming came through HTML, JavaScript and later Visual Basic, are now offered a smoother transition
into mastering a powerful and fully object-oriented language like Java. Experienced Visual C++ developers, on the
other hand, are given a great resource to develop strong Windows applications that will invariably require less
debugging and thread-mangling than their C counterparts. Through all of this, Microsoft has set the foundation
for Java's strengths as a language to eventually make it the primary Win32 development cornerstone as Windows heads
into the 21st century.