Wednesday, March 23, 2011

Comparing uniPaaS and Java: Can’t We All Just Get Along?

Recently, we conducted an interesting challenge with uniPaaS Jet. We asked an independent developer already familiar with Java programming and having no previous uniPaaS experience to download uniPaaS Jet, learn it and create a simple program using uniPaaS Jet. (We had earlier asked them to create the same program using Java.)

We asked them to take careful notes of the resources required and the effort involved. uniPaaS proved itself more efficient in every category. uniPaaS used half the memory and half the file storage. uniPaaS required barely 1% of the logical lines of code and 7% of the physical lines of code. The uniPaaS program executed for the first time in 1/10th the amount of time. The applied effort was 202 hours in Java and only 3.2 hours in uniPaaS. The project duration was 2.63 months in Java and part of a single day in uniPaaS.

Our purpose in reporting these findings is not to engage in Java bashing or point out Java weaknesses, in fact uniPaaS is very Java-friendly. We have some Java developers in our R&D department. And most important we believe uniPaaS can offer much to Java development teams to provide them with tools that can take advantage of their investment in Java while providing them the kind of advantages experienced by the independent developer mentioned above.

The Java Integration built into uniPaaS allows uniPaaS to interface with a Java class or Enterprise JavaBeans (EJB) by using pseudo-references that represent instances of Java classes or EJB files. Pseudo references are an identifier representing the values from a class instance in a BLOB variable. Programs must pass this identifier to access the methods and variables of a class instance. A Java class is a template definition of the methods and variables in a particular kind of object. An object can be a specific instance of a class and can contain real values instead of variables. For integration to Java classes by a uniPaaS application, you can access static methods and variables without the pseudo-reference.

Java instances, static methods and variables are invoked by uniPaaS’s Java and EJB functions. In Java, a class instance is a specific implementation of the Java class while a static class method is a class method that can be called without instantiating the class. Likewise, a static class variable is a class variable that can be accessed without instantiating the class.

An Enterprise Java Bean (EJB) is an architecture for defining Java program components that run on a client/server network. The uniPaaS EJB Component Generator is a wizard that generates a component containing uniPaaS programs that call a Java class or EJB functions. A Java Native Interface (JNI) lets non-Java programs interact with Java programs. The Java Component Generator is a wizard that lets uniPaaS automatically access Java classes or EJB files by creating a component that eliminates the need to specify JNI signatures. You can also use uniPaaS to generate Enterprise Java Beans (EJBs). Clients operating within a J2EE environment are able to view and activate uniPaaS programs as EJB methods. You create the EJBs using uniPaaS’s Component Builder utility.

uniPaaS can create an instance of a Java class that lets you activate a method, or query and update variables using a pseudo-reference. The pseudo-reference is a BLOB variable that represents the Java class instance. When a method is invoked, the BLOB variable returns values to the uniPaaS program as function return codes. Class static methods and variables can also be accessed without having an instance of the Java class by using the class name and the method or variable name.

The uniPaaS Java functions are used to simulate the calling methods in Java. Each context of the engine internally maps between the pseudo-reference and the actual reference.

For example, a uniPaaS program can call the JCreate function to create a pseudo-reference as Virtual Variable A. The actual reference to the instance is then internally associated with Virtual Variable A. Any uniPaaS program in the context will be able to access the methods and variables of the object by using JCall(A,...).
The Java functions can be called by a uniPaaS program to:

• Create a new instance of a Java class
• Call a method directly from the Java class or from an instance
• Report and return exceptions
• Query and update variable values

The EJB functions enable uniPaaS to explore and invoke Enterprise JavaBeans.

I think the important message here is that uniPaaS can help Java programmers make efficient use of Java classes and EJBs while benefitting from the efficiencies of uniPaaS’ smart application development platform. For additional information access the Magic Software DevNet or contact your local office.

Glenn Johnson is a Senior Vice President at Magic Software Enterprises, Inc. Active in the software industry since 1984, he frequently speaks at industry conferences and writes for numerous publications.