|
Microsoft Surprise - A New Way To Link Java Is Really A New Way To Lock Yourself Into Windows
June 11, 1997
Microsoft is backing away from its much-vaunted Common
Object Model for a critical function: tying Java apps to Windows.
In its place is "@dll.import,'' a new technology
for accessing Windows code that may replace the COM interfaces used today.
The @dll.import technology will debut in the next version
of Microsoft's Java Software Development Kit (SDK), expected out in a month,
said Kevin Miller, lead program manager in the applications and Internet
client group at Microsoft. Microsoft said the tool has no larger implications
for COM.
The key point of @dll.import is to link Java programs
to non-COM-based Windows Dynamic Link Libraries (DLL), which are sets of
compiled code that can be loaded and unloaded on demand.
``This will be easier than the COM way of doing things.
It's hard to access native DLLs in some cases with COM, and in other cases,
unimaginatively painful,'' Miller said.
COM, which Microsoft program manager Greg Dimescheli described
as a framework for running components on multiple platforms, is a method
of expressing interaction between distinct functional pieces.
However, COM does not effectively solve the software problem
of getting what is known as C, C++ and Java ``types'' - the dictionary
definitions of what component functions do - to work together, acknowledged
Miller.
"The No. 1 cause of performance nightmares comes
from marshalling to a new thread every time you cross from native code
to Java.''
Microsoft's own internal tests have highlighted some severe
COM-to-Java conversion problems. In addition, there are problems in the
way Java's memory allocation mechanism, called the garbage collector, deals
with objects written in COM.
Miller, who had been scheduled to present a talk entitled
``Effectively Using Java with COM and ActiveX'' at last week's Object Expo
conference here, told his audience of programmers he was dumping the subject
of the talk because Microsoft had just found a better way.
"The @dll.import will provide easy access to Win32
DLLs and third- party DLLs,'' Miller promised. "It answers a lot of
the problems we've had in writing code in Java.''
The COM technique for accessing native Windows code in
Java, called the Raw Native Interface (RNI), requires the programmer to
manually manage the garbage collection, Miller said. ``But @dll.import
automatically does the garbage collection for you, automatically moves
the types across from one side to another,'' Miller said.
Sun Microsystems, Inc.'s JavaSoft division has urged companies
to stick to "100% Pure Java'' and not use COM - which is the basis
of ActiveX - since it renders an application platform-dependent. For instance,
the Sun Java Virtual Machine, available in Sun's HotJava browser and its
Java Development Kit, cannot import COM objects, although Microsoft's Java
Virtual Machine can.
Sun claims @dll.import is no better. "This is sad,''
said JavaSoft senior staff engineer Larry Cable. "They've found a
new way for people to lock themselves into the Windows environment.''
Source: Network World
|