Hi Rafael,
Nice to see you again :).
The nice feature of FM3 is that it is small. Your change would imply extending FM3 with
alias information, and then getting the code generators to understand this part.
The problem is that the use case we are talking about is so small, that I am not sure it
warrants the trouble of changing FM3.
But, could you tell us more about the use case you are in? Is it generating Famix an
action that you have to do all the time?
Cheers,
Doru
On 28 Apr 2011, at 12:34, Raffael Krebs wrote:
Hi all
I am a student at the University of Bern and for my Master's Thesis I am using the
FAMIX metamodel and I also intend to use Fame.
One thing that is most valuable for me is the possibility to generate metamodel stub code
from an fm3 mse file, in my case Java classes.
While filling in the stub classes for FAMIX core, I realized that much of that work could
also be done by the generator, if only it had some additional information. So I suggest
adding that information as pragmas.
Let me explain that on behalf of an example.
The message FAMIXNamedEntity>>belongsTo should be overridden in all of
FAMIXType
FAMIXScopingEntity
FAMIXMethod
FAMIXFunction
FAMIXLocalVariable
FAMIXUnknownVariable
FAMIXGlobalVariable
FAMIXParameter
FAMIXAttribute
FAMIXImplicitVariable
(and more outside FAMIX core)
but a code generator does not know that, so I have to implement the corresponding
messages/methods by hand. That is a bit annoying since this really is very simple code
that could easily be generated.
Example for one of the methods that have to be written by hand:
FAMIXAttribute>>belongsTo
^ self parentType
Every implementation of 'belongsTo' looks like that, i.e. is a very simple
delegate, or let us call it an "alias".
I suggest to add the information about such "aliases" to the pragmas:
1) add <alias> to NamedEntity>>belongsTo
2) add <aliasedBy #belongsTo> to all subclass properties, e.g. to
FAMIXAttribute>>parentType
Then, with that kind of information in an mse file, a code generator could do more work
for me and I had time to drink an additional coffee or two :)
And maybe metamodel browsers can profit from that kind of information, too.
Cheers,
Raffael Krebs
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"To lead is not to demand things, it is to make them happen."