DataBasic Objects or Web Service, which to use when calling external Java
This depends on whatever is most appropriate for the application, based on what needs to be done and what data is passed between Reality and Java programs.
The DataBasic - DBO feature enables you to invoke any available Java code. The DBO code in DataBasic connects to a Java Language Server supplied by NPS. It was originally conceived that the Java server would be running on the same system as the Reality server. However, as it uses sockets it could be sited on a server anywhere, or even to update the users local PC. The main driving point was to enable access to readily available Java classes (like those to create pdf or excel files). It is very flexible and powerful, but can be difficult for developers to get their head round as they need knowledge of both DataBasic and Java. In fact it would be easier for a Java programmer to use than a DataBasic programmer.
The DBO should be more efficient than a web-service as there is no web server involved and no conversion to XML and back. However, every method call results in a message being sent to the Java server and this must then locate the correct method and signature using introspection, which is not fast.
A well written web service that minimises communication between Reality and Java could be more efficient, just because it reduces the communication overhead. However, this could never provide the flexibility that DBO provides.
As an example, it is difficult to see how using a web service to create a pdf, could provide all the formatting features direct access to the Java classes can. So if the design calls for a straightforward process a document as a lump and get a result, then a Web Service may be best. However, if you want to use the power and flexibility of Java from within DataBasic then DBO is the only way.