AG VLSI Design an d Architecture

SFB 501 - Project D1: Application System "Buildings"

PEdit

Pattern-binding Editor

[PSiGene]



Description

The Pattern Binding Editor (PEdit) can be used to instantiate Patterns from our Pattern Catalog and bind them to a class model. This class model describes the static aspects of a software component and can be created using a MOOSE editor.

After loading a class model and a domain-specific pattern catalog, patterns can be bound to the class model. This is done by instantiating appropriate patterns and by selecting values and assigning them to the pattern's interface. The interface of a Pattern is described by formal parameters. Parameter types are used to ensure that only syntactical correct bindings can be performed. The type of a formal parameter can be one of: Object, Relation, Attribute, method interface (Interface), method implementation (Method), or Expression. In addition to these types, a formal parameter can have the type Set of Objects, Set of Relations, or Set of Methods. The latter parameter types are used to bind a Pattern to more than one relation or method.

We distinguish between method implementations and method interfaces (compare template-and hook-methods in /Pre95/): the code generation for a pattern will be done for method implementations whereas interfaces are used to communicate with other objects or patterns. The pattern editor, by comparing formal parameters with actual bindings, enforces that only correct bindings can be used. We allow subtyping to get more flexible pattern bindings, e.g. an attribute can be accessed via a corresponding method so that a formal parameter of the type method interface can also be bound to an attribute.

The following picture shows the user interface of PEdit. Click on the image to get the screen dump in its original size. Rectangles and lines represent classes and relations respictively, while clouds represent pattern instances. Bindings of type Object are displayed as diagonal lines.

screen dump

Pattern bindings are performed using special edit windows:
edit window The user can select a formal parameter he wants to bind to the class model and is then prompted for the value that should be assigned. In case of attributes, relations or interfaces this can simply be done by selecting a possible value from a select box.

Each parameter may only be useful within a certain context. E.g. choosing an attribute from a certain class can only be done if it is known from which class the attribute should be taken. Therefore PEdit allows the definition of such contexts and ensures that bindings are done in the correct context.

After all pattern bindings are made, PEdit generates a POC-file that is used by our Pattern generator to generate source-code. An example POC-file might look as follows:

...
ThermalMass
        bind: 'target' to: 'Room';
        bind: 'amountOfHeat' to: 'amountOfHeat';
        bind: 'volume' to: 'volume';
        bind: 'getHeatFlowFor' to: 'getHeatFlowFor';
        bind: 'compute' to: 'doCalcLoop';
        bind: 'temperature' to: 'temperature';
        bind: 'getHeatCapacity' to: 'heatCapacity'.

FollowRelationAndSum
        bind: 'target' to: 'Room';
        bind: 'relation' to: '#(#Surfaces #intoWalls )';
        bind: 'parameter' to: 'theCaller';
        bind: 'operation' to: 'getHeatFlowFor'.
...

The formal interface of each pattern is described with a separate description file. These descriptions can be loaded dynamically into PEdit. The description of one of our Patterns (ContinousComputation) looks as follows:

Pattern ContinuousComputation Category active
        ObjectType use target
        SingleRelation use activeObject
        SingleRelation use event
        Attribute use preset interval
        SingleMethod implement preset establish
        SingleMethod use compute
        SingleMethod implement preset init
        Expression implement priority
End
The format for these description files can be found here.
Table of Contents PSiGene