close Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes to JCop's Language Design and Syntax


  • The keyword context has been replaced by contextclass.
  • staticactive keyword for context declarations:
      public staticactive contextclass Ctx {
          when(<expr>) : with(new MyLayer());
    A static context is globally active. It cannot be instantiated but exists as a singleton. At the current status of implementation, a static context needs to be imported in at least one compilation unit.


  • Modified syntax for layer activation declarations. Brackets are replaced by a colon after the pointcut part:
      when(<expr>) : with(new MyLayer());


  • Layers are now instantiable. Like normal objects, they can override their default constructor and have to be instantiated. Example:
      with(new ContactLayer(myContact)) { ...}
    JCop programs using the old syntax will cause a compiler error:
      with(ContactLayer) { ...}
    You can fix this effortless by defining a class variable:
    private Layer ContactLayer = new ContactLayer();
      with(ContactLayer) { ...}
  • The in predicate has been removed.
Last modified 9 years ago Last modified on 12/08/2011 10:27:04 AM