Fame is the meta-meta-model of Famix. In the following, we mainly present the Pharo implementation and usage of Fame.
It consists of 6 main entities:
Fame defines 4 constants:
true
or false
Fame is implemented in the following programming languages:
The last stable version of Fame is always includeds in Moose.
The project can be found in the packages prefixed with Fame-
.
It is also possible to install Fame in a fresh Pharo image. To do so, execute the following script:
Metacello new
githubUser: 'moosetechnology' project: 'Fame' commitish: 'v1.x.x' path: 'src';
baseline: 'Fame';
load
Fame supports two file formats to export meta-models: MSE, and JSON.
The new JSON file format should be chosen preferably. It can use with the following script:
String streamContents: [ :writeStream | MyModel metamodel exportOn: writeStream usingPrinter: FMJSONPrinter ]
To export a model (or meta-model) in the mse format (for example, to use FameJava and VerveineJ), execute the following code:
'/path/to/file.mse' asFileReference writeStreamDo: [ :writeStream | MyModel metamodel exportOn: writeStream ]
It is also possible to import a Fame model from a JSON and a MSE file.
To import a model please use the following script:
"aMetamodel is a Fame Metamodel"
"Considering you want to import a FamixJavaModel"
"aMetamodel := FamixJavaModel new metamodel."
model := FMModel withMetamodel: aMetamodel.
importer := aBlock
value:
((FMImporter model: model) autorizeDandlingReferencesAtEnd
"Replace FMJSONParser with FMMSEParser when importing a model stored in a MSE file"
parser: FMJSONParser;
stream: aStream;
yourself).
importer run.
When using a Moose image, some methods are implemented to simplify the script.
For instance, one can use FamixJavaModel>>#importFromJSONStream:
and FamixJavaModel>>#importFromMSEStream:
.