REALbasic, Heir to Visual Basic 6?

REALBasicImages/realbasic-logo.jpg
REALbasic is an object oriented version of the BASIC programming language. It shares some similarity with Visual Basic 6, but also has differences. There is a slightly outdated whitepaper by Hank Marquis, which points out the most significant differences.
Most importantly, REALbasic as a language is probably closer in architecture to Visual Basic.Net and even C#, than it is to Visual Basic 6. The samples in this Code Project article comparing Visual Basic.Net and C#, shows the syntactical similarity of Visual Basic.Net and REALbasic.
Which means that REALbasic can, and should, be considered as a possible alternative to moving to, or using, .Net technology for a specific project.
The two leading arguments for using REALbasic are its capability of producing a single file executable, and cross compiling for the Windows, Mac OS X, and Linux platforms. The second argument is gradually becoming more blurred, with the advent of a Visual Basic.Net compiler from the Mono project. Similarly, for software houses that develop only for the Windows platform, cross compilation has little commercial significance. Nonetheless, the single file executable is still a notable advantage over having to ensure the correct configuration of (possibly) some specific version of the .Net or Mono runtime environment, on each client's computer.
Making the decision to change from Visual Basic 6 to some other platform has to be looked at from two different and potentially clashing prospects. The software house, in the form of a product manager, will be looking for the most cost efficient choice. The software developer will probably be more interested in convincing the product manager to choose the “latest and greatest” in terms of programming languages and environments.
Making the choice depends on a series of factors. Most Visual Basic 6 projects were designed to produce either stand alone Windows desktop applications, or client applications communicating with back end servers, usually databases.
The software house can choose to continue developing and maintaining their original Visual Basic 6 projects. For the short term, this is unlikely to create problems, but eventually the applications may fail to work on new versions of Windows, or may not have the same “look and feel” as newer applications, and Visual Basic 6 programmers may become more difficult to find.
Switching development to languages such as Java or C# will require a great deal of time to retrain Visual Basic 6 programmers, and to learn the enormous number of libraries available. On the other hand, finding Java and C# programmers is an easier task, as both are popular languages. However, the risk of failure is very high, and both languages require a runtime environment for the programs to work. Java has not had a particularly successful track record for client application development.
Switching development to Visual Basic.Net, which seems to be the commonest choice, is still prone to risk. The language is too similar to Visual Basic, while being a radically different architecture, which can be a cause of confusion. The same runtime environment problems are applicable as for C#. The Visual Basic 6 Resource Center provides information on the upgrading process.
Switching to REALbasic is also prone to some risks. As for Visual Basic.Net, project conversion programs exist, but cannot be considered to be a completely 100% automatic process. However, the learning curve for Visual Basic 6 programmers is lower, the syntax is similar without being radically different in architecture, and the support libraries are smaller. Being object oriented, the language syntax is not too difficult for Visual Basic.Net, C#, or Java programmers to learn quickly. There are little or no runtime environment problems.
The rest of this article explores a couple of applications, discusses project conversion, and provides further resources for REALbasic programming.

The Database Example

REALbasic comes with a surprisingly detailed database example, including a 66 page PDF development manual. The application demonstrates normal CRUD (Create, Read, Update and Delete) operations on three associated database tables, customers, products, and orders.
The first diagram, below, shows the Customers panel, running under Windows XP.
REALBasicImages/db-1.png
The second diagram, below, shows the orders panel, using the filter “no” on the company name.
REALBasicImages/db-2.png
The third diagram, below, shows the customers panel, again with a filter set.
REALBasicImages/db-3.png
Standard display widgets are used in this program, to maintain multiplatform compatibility, which produce an acceptably professional interface. REALbasic has a richer collection of GUI widgets when compared to Visual Basic 6.
In particular, the data table, which lists the records for each database table, allows the user to sort (ascending or descending) by column name. Clicking on a table line fills in the form below the table.

The Syger XML-RPC Example

This is one of our own examples, which is a reworked version of Jan G.P. Sijm's open source XMLRPCCOM project, which was written in Visual Basic 6. This small REALbasic project was designed to show some fairly straightforward object oriented design principles to Visual Basic 6 programmers, and as a proof of concept for an XML-RPC based client application.
The source code is released under the GNU Lesser General Public License. Both project files need to be built in order for the complete set of tests to be run.
The client program provides a series of tests via its menu bar. The External HTTP menu item provides three commands which are sent to the University of Calgary XML-RPC server.
REALBasicImages/Client-Menubar-2.png
Before sending commands via the Localhost HTTP menu item, the server must be started. This can be achieved by launching the application normally, or via the Program menu item.
REALBasicImages/Client-Menubar-1.png
The Localhost HTTP menu item provides four commands, the first three of which are identical to the external HTTP server. The last command shuts the server down.
REALBasicImages/Client-Menubar-3.png
The following screenshot shows the client application communicating with the external HTTP server, displaying the result of calling the “Parameter creation” function.
REALBasicImages/Client-1.png
The second screenshot shows the client application communicating with the localhost server, displaying the result of calling the “Value mapping” function.
REALBasicImages/Client-2.png
The final screenshot shows the logging information in the localhost server application.
REALBasicImages/Server-1.png

Conversion Tools

Since REALbasic is a more object oriented programming language than Visual Basic 6, any converted Visual Basic 6 project will probably be, at best, the equivalent of a poorly written REALbasic project. Nonetheless, the idea of being able to convert from one to the other, using some automatic conversion tool, is a tantalising prospect.
Although REAL Software provides a conversion tool called VB Project Converter, it seems that, according to this article by Bob Keeney, there are better tools available, in particular a product called VB Convert!. Bob's software company also provides conversion services.
VB Convert! goes to great lengths to explain why a 100% conversion is an unrealistic proposition. Syger has had a similar experience of converting a Cobol program to Java. After some cleaning up of the original Cobol program, about 80% of the program was successfully converted, the remaining 20% (mostly database connections, and queries) were translated by hand. The resulting program was closer to being a Cobol emulator in Java, rather than being a well written Java program. Nonetheless, it achieved its goal – the program worked correctly, with exactly the same functionality of the original, and within the project development time frame. A complete rewrite in Java would have taken at least three to five times the amount of work.
Using VB Convert! is probably a good starting point, as the program is relatively inexpensive (about US$50), and can be expected to convert a major portion of the Visual Basic 6 code. As the author of VB Convert! points out, this may involve cleaning up the original Visual Basic code, and results may also depend on the amount of external COM and ActiveX objects used.

Resources

The REALbasic web site provides a starting point to information on REALbasic, the language, the community, and support available.
RBDevZone hosts a small set of open source projects, including RBUnit, a unit testing framework for REALbasic.
Einhugur and MonkeyBread Software provide a collection of commercial plugins and controls for REALbasic. RB Garage has a large collection of links to resources for REALbasic developers.
Software In Motion provides a code analyser called Reality Check.
Great White Software has a list of REALbasic modules.
Electric Butterfly provides a cross platform help system for REALbasic, called UniHelp.
Various blogs are available, including declareSub.com, Envied Design, Ramblings, Software Made Simple, This Much I Know, and nilobject.

Contacts

Syger can be contacted for consultancy work on any of the topics mentioned in this article, by sending an email to info@syger.it.

Valid CSS

Valid XHTML 1.0

Valid Atom 1.0