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.

Version 12 (modified by malte.appeltauer, 10 years ago) (diff)


Changes to JCop's Language Design and Syntax


  • static keyword for context declarations:
      public static context Ctx {
          when(...) : 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 importet in at least one compilation unit.


  • Modified syntax for layer activation declarations. Brackets are replaced by a colon after the pointcut part:
      when(...) : 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)) { ...}
    Older JCop programs will cause a compiler error:
      with(ContactLayer) { ...}
    You can fix this effortless by defining a class variable:
    private Layer ContactLayer = new ContactLayer();
      with(ContactLayer) { ...}