Hi,
On 19 Sep 2011, at 09:50, Stéphane Ducasse wrote:
I wanted to address the following issue
Look for senders of:
propertySignature
<property: #XXX longName: 'YYY' description: 'ZZZ'>
And replace with:
propertySignature
<MSEProperty: #propertySignature type: #Number>
<MSEComment: 'ZZZ'>
but I do not understand it :(
numberOfMessageSends
<property: #MSG longName: 'Number of message sends' description:
'The number of message from a method'>
^self
lookUpPropertyNamed: #MSG
computedAs:
[self mooseModel isSmalltalk
ifTrue:
[| parser |
parser := VisualWorksParseTreeMetricCalculator new.
parser processMethod: self usingImporter: nil inModel: nil.
parser numberOfMessageSends]
ifFalse: [-1]]
numberOfMessageSends
<MSEProperty: #numberOfMessageSends
<MSEComment: 'Number of message sends' description:
'The number of message from a method'>
^self
lookUpPropertyNamed: #MSG
computedAs:
[self mooseModel isSmalltalk
ifTrue:
[| parser |
parser := VisualWorksParseTreeMetricCalculator new.
parser processMethod: self usingImporter: nil inModel: nil.
parser numberOfMessageSends]
ifFalse: [-1]]
How does the system know after that the property is linked with #MSG if MSG is not part
<property: #MSG longName: 'Number of message sends' description: 'The
number of message from a method'>
Why do we duplicate the method selector?
This is the pragma used by Fame. Essentially, you could theoretically use a different
selector for the Fame property than for the actual implementation.
why do we create comment as a separate entity. To me
it looks like we are looking for complicated queries after.
No. The thing is that the comment is optional, and so is the <derived> or
<multivalue>. So instead of creating a tone of possible combinations, we use
individual annotations and we combine the as needed. This works reasonably well.
I still do know how I can get a method containing two
tags in one query.
We use the crappy Pragma protocol.
For example:
Pragma
inMethod: FAMIXType>>#attributes
named: #MSEComment:.
==> <MSEComment: 'List of attributes declared by this type.'>
What is the rationale? Why having a comment directly
in would be a bad idea.
See above.
So guess what? I will wait because fixing the 122
left.
Sure. Fixing core things is quite straightforward.
Cheers,
Doru
Stef
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"Some battles are better lost than fought."