On 2 sept. 2010, at 16:59, Alberto Bacchelli wrote:
Hi,
Other than reading the paper
FAME—A Polyglot Library for Metamodeling at Runtime*,
where can I find some *simple* examples/tutorials
on how to deal with FAME?
- There are some examples in Fame-Example
- Read the code belonging to Famix-Core package, it only contains Fame-generated code (so
ignore all extensions). You actually only need to care about pragmas, since code can be
generated.
Now the tricky part in Fame is to understand the bi-directional relationship and how to
declare them with pragmas. Fortunately there are very few pragmas to learn. They are
described there if you need (it should be put on the website actually):
http://code.google.com/p/moose-technology/wiki/FameMetaDescriptions
So what's my usual process basically:
1) create classes
2) create methods for attributes with just pragmas (no instance variable, no definition in
method body)
3) export this metamodel as mse
4) import mse as a metamodel into a fresh image and generate classes from the metamodel
5) check that the generated classes are as expected
For 3-4, take a look in MooseModel class-side, categories import-export and meta
What else? The other tricky part is to check the consistency of pragmas declaration. For
that there are some Lint rules dedicated to Fame, accessible from the meta browser. (BTW,
there are still remaining issues in this area right now)
--
Simon