![]() |
|||||||||||||
![]() |
|||||||||||||
|
|
|
|
|
|
|
||||||||
![]() |
![]() |
|
|||||||||||
| |
|||||||||||||
FAQ
The Beelucid philosophy is that you should be able to leverage your software investment across platforms according to your business requirements. Our mission is support you in this task. Java is the target language of VBeeJ because it has many compelling attributes. Here is a quick summary:
Also, Java is platform independent. Your code will run on any operating system. New versions of Java are for the most part strongly source compatible with previous versions. Java is free. Java standard class libraries are free, large, diverse, and secure. Free, robust, and advanced development envionments are available for Java. (For an example, see the Eclipse Platform. All examples in Beelucid documentation use the Eclipse Platform (3.2.0). VBeeJ can be as an external tool within the Eclipse SDK. Click the link to see the Run->Run... menu showing that setup.) Java has a huge standard class library. The functions supported by this class
library range from simple String support to networking and graphic user
interface creation. Java is a reasonably large programming language,
but its complexity is easily superseded by the class library. Sun licenses the
source for the class library, so any vendor that agrees to Sun's terms can
support the class library on their Java platform. As a result, the Java class
library is both large and ubiquitous, creating a standard software environment
on all Java platforms. The great popularity that Java has enjoyed has
resulted in a huge body of literature on all aspects of the Java class library.
This reduces the learning curve and makes the class library easier to use.
VB6 and VB.Net are quite different languages in syntax, features, and underlying object
model. VB6 must first be translated to VB.Net before VBeeJ will be able to handle it.
There are a number of tools available that handle the translation from VB6 to
VB.Net. After the VB6 has been translated to VB.Net, VBeeJ can translate it to Java.
VBeeJ accepts all of VB.Net 2003 (VB 7.1) and many of the features in VB.Net 2005 (VB 8.0), including inheritance of generic types, the Using keyword, and more. Unsupported features in VB 8.0 may get parse errors for unrecognized syntax and the translation will not occur. Implementation of VB.Net 2005 is ongoing. Please contact Beelucid Support if you have particular requirements. Back to top Installing VBeeJ
Running VBeeJVBeeJ can be run with the gui, or from the command line, or as an external tool within the Eclipse Platform. All the examples show VBeeJ used as an external tool within the Eclipse Java IDE, Version 3.2. Note that VBeeJ requires a jre of version 1.6.0 or higher to run.
No. VBeeJ produces Java source files which can be used with any Java development environment.
If you are unfamiliar with Java development environments, the Eclipse Platform
is a good (free) choice. VBeeJ can be conveniently run as an external tool under the Run menu within this environment. Here is a simple example, where the input and output is shown in the Eclipse Platform (version 3.2).
'Info' messages are messages which describe the translation choices made by VBeeJ. They are for infomational purposes, to help you understand the generated code better. In general no response is required. In the message, the source file name is followed by a line number and message category, and followed by the message text. [TestRedim.vb] 1: Beelucid info: Every Visual Basic namespace creates a package directory in the Java context (namespace 'TestRedim') Click the link to view an example of VB.Net source with its translation and translation messages. The linked example shows info messages, warning messages, and an error message. Back to top'Warning' messages are messages which notify the user that the Java translation may not completely match the VB.Net functionality for all cases. You should check the code indicated by these warning messages. The more common cases will most likely require no modification. In the message, the source file name is followed by a line number and message category, and followed by the message text. [TestRedim.vb] 6: Beelucid warning: Visual Basic operator 'GetType(<className>)' translated to Java '<classname>.class', which has equivalent but not identical functionality and syntax. Click the link to view an example of VB.Net source with its translation and translation messages. The linked example shows info messages, warning messages, and an error message. Back to top'Error' messages are messages which notify the user there is no Java construct or functionality that can be automatically translated to implement the VB.Net statement. There aren't many of these and they are mostly generated for features included in VB.Net for VB6 compatibility. You will need to check the code and manually translate. In the message, the source file name is followed by a line number and message category, and followed by the message text. [TestRedim.vb] 8: Beelucid error: 'ReDim' statement requires manual translation if the operand has not been declared with specific dimensions but is an object of 'Array' type (array name 'my3DIntArray'). Click the link to view an example of VB.Net source with its translation and translation messages. The linked example shows info messages, warning messages, and an error message. Back to topVBeeJ is designed to be flexible, powerful, and robust even when information about class definitions and interfaces used by the source program is missing or incomplete. It contains a powerful type inference engine. This allows it to handle missing classes and interfaces in source programs and also allows VBeeJ to gracefully and consistently handle changes in the .Net platform itself or in the VB libraries. Click the link to view an example that shows a VB.Net source program which contains references to a class whose definition is not available. The translated code is also shown. Note the last message is an 'info' message that indicates that VBeeJ found references to a class whose definition is not available. The user is directed to the beelucid directory where a stub class for this type has been created, with methods inserted as appropriate. Method signatures were inferred by the type inference engine. Click the link to view the stub class in the beelucid directory. Back to topVBeeJ creates a beelucid directory which contains Java support for .Net functionality as well as stubs for classes whose definition is not available in the VB.Net source. Click the link to show the contents of the beelucid directory for a test case. This example shows only the minimum default contents of the beelucid directory. This example does not contain any references to classes whose definitions are not available. Note that the Bridge classes which support Events and EventHandlers are listed, as well as a few Bridge classes. The latter provide a 'bridge' between similar classes on the different platforms. The SystemBridge class supports platform and library functionality. Click the link to show the contents of the beelucid directory for a test case which does contain references to a class whose definition is not available (the class called UnknownClass). Note method stubs for the class have been generated. The signatures of the method stubs have been inferred by the type inference engine. The contents of the beelucid directory will vary depending on the characteristics and requirements of the source program. All class definitions are in the form of Java source files. Back to topVB.Net supports primitive types Boolean, Char, Byte, Short, Integer, Long, Single, and Double. Java's parallel types are boolean, char, byte, etc. Basic types in Java and VB.Net behave identically in some contexts but not in others. Where they behave identically, the translation is direct. Where they do not behave identically, a Bridge type wrapper object is created, that wraps the underlying basic value. The Bridge type definitions are contained in the beelucid directory. For example, a VB.Net statement of the form Dim II As Integer = 3 translates directly into the Java variable initialization statement int II = 3; VB.Net primitive types and Java basic types are parallel but they do not behave identically in all contexts. The VB.Net variables are objects which support services. An int variable in Java is a simple value. When this difference results in a difference of functionality or behavior, VBeeJ uses bridge types to bridge the difference. The goal is to have your VB.Net program translate into legal Java. For example, in VB.Net, the following variable initialization relies on the fact that Integer variables are object of class Integer: Dim II As New Integer(3) 'Integer is a class and 'New' creates a new Integer object A direct translation of this into a Java initialization would not be legal because int is a value not an object type: int II = new int(3); // Illegal Java because 'new' can't be used to create a value In this example, VBeeJ will generate a IntegerBridge class in the beelucid directory in order to create the int value: int II = new IntegerBridge(3).intValue(); The IntegerBridge class creates an object which is a wrapper for the underlying Java basic int value, and the method intValue() returns that underlying value. Back to topThe SystemBridge contains stubs as well as some implementations for library and system functions, some generated by default and others generated because they were identified in code. Click this link to view the default SystemBridge class. Back to topVBeeJ implements complete and robust support of support of events and event handling. For events, the class EventBridge is generated. This class associates an event object with a set of handlers, which can be added and removed. For event handling, the class EventHandlerBridge is generated, which supports associating a handler with an event object. VBeeJ will generate all the code needed to fully implement in Java the event and event handling functionality in your VB.Net program. Click this link to view a VB.Net example Test.vb which has a WithEvents variable, an event class, an event handler, and raises an event. Click this link to view classes in Test.vb after they've been translated into Java. The translated classes use the bridge classes. The VB.Net Event variable MyEvent has the type in Java of EventBridge, which associates MyEvent with a set of handlers. The class declaring this event, MyEventClass, utilizes the class EventHandlerBridge, to support associating handlers with MyEvent. For a high level view of EventBridge and EventHandlerBridge click this link . After running the source through VBeeJ, this example compiles and executes identically on both platforms with no modification. Back to topVBeeJ translates Decimal in VB.Net to BigDecimal in Java. This means that operations performed with operators in VB.Net are performed with BigDecimal methods in Java. Click this link to view an example. Back to topAt this time attributes are ignored. If you have suggestions as to particular attributes which you think should be supported, please send an email with your thoughts and rationale to Beelucid Enhancements. Thanks in advance for your input. Back to topVBeeJ supports VB.Net 2003 and many of the features of VB.Net 2005. This means other versions of VB may not parse, although implementation of VB.Net 2005 is ongoing and upgrades with its features will be regularly available. If you think you have a bug, please file a bug report. Back to top |
|||||||||||||
![]() |
|||||||||||||