JCop

JCop

JCop is a context-oriented programming (COP) extension to the Java programming language. It combines COP features - introduced by its predecessor ContextJ - with new constructs for declarative and event-based layer composition and a first-class event-based context representation.

Modularization. Behavioral variations are modularized by layers that can either be defined within classes (layer-in-class) or in dedicated top-level modules (class-in-layer). Layers contain partial method definitions that extend or replace a plain method while their layers are active.

Dynamic Composition. JCop provides control-flow specific layer composition as known from other COP languages. In addition, it offers declarative composition statements that are specified within context modules and thus combines COP with concepts of aspect-oriented programming.

Download & Installation

Unzip JCop into a folder and add its path to the PATH environment variable.

Compile & Run JCop Projects

The JCop compiler implementation is based on the JastAddJ Java compiler and generates Java 1.6 byte code. The compiler is able to parse Java and JCop syntax (files ending with .java and .jcop).

To compile a JCop project, use:

To run your compiled project, use: