This is an Archived Page
The programming language OT/J implements the programming model Object Teams for the host language Java.
OT/J Language Definition (OTJLD)
- Current version online: http://www.objectteams.org/def/1.3
- Frozen release 1.2 as printable document:
- OT/J Primer -- to be written
- Either of the following publications can be read as an introduction to OT/J:
- Object Teams: Improving Modularity for Crosscutting Collaborations -- (Net.ObjectDays, 2002)
- Model-View-Controller and Object Teams: A Perfect Match of Paradigms. -- (AOSD 2003)
- A Precise Model for Contextual Roles: The Programming Language ObjectTeams/Java -- (Journal Applied Ontology 2007)
- The Examples page shows an introductory example and links to further examples.
- OtPatterns show OT/J in action regarding recurring problems and their solutions.
OT/J is compiled by a modified version of the Eclipse compiler for Java. This means that the OT/J compiler can also compile any Java program. While OT/J introduces some new keywords most of these words are still treated as normal identifiers until the keyword team has been parsed (OTJLD §A.0.1 -- "scoped keywords"). This provides the greatest possible compatibility at the syntax level.
The compiler can be invoked either from the ObjectTeamsDevelopmentTooling (OTDT) or as a command line compiler. For compiling OT/J source outside Eclipse please see CompilingWithAnt.
The compiler produces regular Java .class files, which are enriched with OT/J specific meta data using Java bytecode attributes. These meta data are interpreted by the OTRE (see below) in order to weave playedBy and callin bindings into base classes. This implies that OT/J programs need to be launched with the OTRE enabled. Other than that any recent JVM can be used.
Object Teams Runtime Environment (OTRE)
As mentioned, running an OT/J application requires the OTRE. Currently three alternative modes are supported how the OTRE can be linked into an OT/J application:
This third-party framework is called as a wrapper that prepares for bytecode weaving before loading the actual application.
This technology is part of the Java standard since version 1.5. Launching an application in JPLIS mode only requires a few items added to the classpath and an -javaagent:... argument, which means the least invasive way of launching OT/J programs like plain Java programs.
By integration of OT/J with the Equinox component framework (Eclipse's implementation of the OSGi standard), also Eclipse plug-ins (RCP, OSGi bundles) can leverage OT/J. In this case running OT/J code only requires to have the OT/Equinox feature installed on top of Equinox.
Within the OTDT the OTRE is enabled by a new checkbox adjacent to the JRE configuration (http://www.objectteams.org/distrib/new_in_1.3.html#launch). An additional checkbox switches the launching mode to JPLIS (default is JMangler).
Weaving into system classes
One advantage of the JPLIS mode is that it can weave into more classes, i.e., even system classes from Java's rt.jar can potentially be bound as base classes (note, that any classes loaded before the OTRE starts operation can still not be woven).