JPOs provide the ability to run Java programs natively inside the
kernel without creating a separate process and with a true object-oriented
integration feel as opposed to working in MQL.
JPOs allow you to write
Java programs on top of the ENOVIA Studio Customization Toolkit programming
interface and have those programs invoked dynamically.
When running inside the kernel, the programs share the same context
and transaction as the thread from which they were launched. In fact,
the Java programs are running inside the same Java Virtual Machine (JVM)
as the kernel.
Java Program Objects are also tightly integrated with the existing
scripting facilities. Developers can seamlessly combine MQL, Tcl,
and Java to implement their business model. Tcl will continue
to be supported and offers a scripting approach that makes sense
in some cases, however the Java language has several advantages:
- Java is compiled, and therefore offers better run-time performance
- Java is object-oriented
- Java is thread safe
Java code must be contained in a class. In general, a single class
makes up the code of a JPO. Simply translating Tcl program
objects into Java is not the goal as it leads to many small classes,
each containing a single method. The very object-oriented nature of Java
lends itself to encapsulating multiple methods into a single class. The
goal is to encapsulate common code into a single class.
A JPO can be written to provide any logical set of utilities. For
example, there might be a JPO that provides access to Administration
objects that are not available in the ENOVIA Studio Customization Toolkit. For the most part, a JPO will be associated with a particular Business
Type and the name of the JPO should contain the name of the Business Type.