Menu

WriteOnceRunAnywhere

Anonymous

The promise

WORA is one of the most important features of java. Years ago, the mother company of Bo2 made an assessment in order to select between Java and .NET. Despite having years of experience with Microsoft development tools and numerous Visual Basic applications the selection was Java. The main reason was the WORA promise.

Visual Basic clients running on Windows desktops were supplemented by a CICS server layer written in Cobol. Countless Cobol batch programs running on the zOS mainframe filled the picture. Java can run on every platform including zOS, CICS. A web application running on an application server under Windows or Linux, a java CICS transaction and a java batch program would be able to use the same java classes.

The reality

Reality proved different. Java runs on all platforms, but important resources as transaction managers, JDBC connections, files are created differently in the different platforms. Pretty soon it turned out that code written for this platform could not be reused on that platform.

The Bo2 solution

The known solution to the problem is dependency injection. Bo2 uses the Provider abstraction for this. Provider is an abstraction of the execution platform. It will create and manage any resource required by the business layer. All resources are provided in the form of a common interface. The ResourceWrapper abstracts the resource management code. Different implementations exist for different platforms (and mode can be built) making it possible to write a platform agnostic (and hence reusable) business layer.


Related

Wiki: GuidingPrinciplesOfBo2
Wiki: RuntimeLayer

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.