In the Demeter Seminar yesterday we discussed that Java packages can be adapted to develop a module system for Demeter/Java. The idea is to reuse the Java package concept as much as possible and add what we need for AP. Here is what I heard from the various contributions by Doug, Geoff and Johan: The following is rough but it will allow us to focus in on a module system. An adaptive package is a Java package lifted to the adaptive level. An adaptive package is a highly generic package where the exported behavior is only loosly coupled to the imported behavior. While Ada or ML also have generic packages, the adaptive packages are an order of magnitude more generic. Instead of dealing with classes they deal with class valued variables, etc. An adaptive package has two parts: an interface and an implementation part. The interface part ========================================================== says what the package exports: this is the behavior provided by the package. It consists of: class-valued variables association-valued variables class names association names Java interfaces Implements clauses of the form: class C implements {I1, ... ,In} The interface part can be visualized as a class graph with multi-sourced edges, called the interface class graph. The implementation part ========================================================== implements the interface part using several other adaptive packages which it imports. It consists of (what we have now in a *.beh file): An import list saying what we use from other packages (behavior required by the package) strategies referring to the interface class graphs of imported packages and to the interface class graph of this package (some behavior which is imported might be also exported). class definitions which may contain traversals (defined in terms of strategies), visitors and adaptive methods. Traversals may go through multi-sourced edges. The methods which are exported by the package must be public or protected. The methods which are not exported must be private. Classes which are exported must have public scope. See the package access mechanism of Java. Producing a Java package ========================================================== An adaptive package is turned into a Java package by customizing it with class graphs. How does this look like? -- Karl