AG VLSI Design an d Architecture

SFB 501 - Project D1: Application System "Buildings"

MPOK

Smalltalk generator

[PSiGene]



Description

MPOK is an Smalltalk (VisualWorks) generator that converts class diagrams into (executable) class structures. The generated code can be seen as an abstract data type (ADT), that is, it can be used to store data and provides access methods to this data. Input class models are created with a graphical editor provided by the MOOSE environment.

The following table gives a short overview of the modeling primitives of the MOOSE-Editor and the code generated from these primitives by MPOK.

SymbolNameDescription / Generated Code
schemaSchema Each group of Objecttypes can be structured in different schemas. A schema represents a software component, a library or simply a group of strongly related objects. The code for each Schema is generated into a separate VisualWorks category.
schema relationSchema Aggregation Schemas can aggregate other Schemas. Aggregating another Schema means, that the other Schema is needed by the first one. Thus, code generation is always done for a Schema and all its aggregates.
objecttypeObjecttype An objecttype is a description of a class of similar objects. Therefore, MPOK generates a smalltalk class for each objecttype.
no graphicsAttributes Attributes with certain types can be specified textually in the MOOSE Editor. The generated code for Attributes consists of: access methods, type checking methods (optional), and a constructor.
isA relationIsA relation IsA relations denote inheritance. If an objecttype is of the kind of another objecttype it inherits all the attributes, relations and methods from the first one (s. example).
normal relationNormal Relation A relation connects two objecttypes. It consists of a relation name and two rolenames. The rolenames are used to access connected objects. A relation can have different cardinalities (1:1, 1:n, n:1, or n:m) and relations with cardinalities greater than one can be ordered or unordered. Here is an example of some of the generated code for a normal relation: definition, access methods.
partOf relationPartOf Relation A PartOf relation is a special relation to describe object aggregation. Thus, to express the fact that one object consists of other objects, a PartOf relation can be used. Currently, no particular code other than "Normal Relaion" code is generated to enforce this behavior.
Common Generated Code
Several other methods are generated to provide additional functionality for the ADT. Data exchange between different (generated) applications can be done with via SLANG files. SLANG is a textual data exchange language. Methods to read and write SLANG files are generated by MPOK. If the data structure in a SLANG file doesn't match the expected structure, the SLANG input ignores additional data or uses default values for unsupplied data. This way, data exchange between different ADTs can be done.

Several other methods that are generate include printing and error handling. This example shows some of the generated code for an ADTs base class.

MOOSE also provides ADT generators for other languages (like C, C++, Versant database, remote access) that provide a similar interface. Data exchange between different applications (that may be written in different languages) can be done via SLANG files.

The MOOSE ADT generators have been used in several (internal) projects and proved to be very useful.


Table of Contents PSiGene