Reputation: 81
I have an Interview question, then I try to find It's question in Internet, but I cant find it.
I answered it, but I still confused with my answer. Because I think Post()
is part of Invoice
class too.
Upvotes: 1
Views: 895
Reputation: 36333
No. The message shows what is called not who/what is calling. So Publish()
is an operation of Invoice
and Post()
is one of GeneralLedger
(called from Invoice
). Validate()
is also an operation of Invoice
. It's just a self-call here.
N.B. I'm using a colloquial description above. To start with, I repeat @Christope's comment that the question itself is flawed.
method
is the wrong term. It is commonly used (mostly in the MS world) but what it should read here is operation (UML 2.5 p. 15: operation owned by a class may have a related method that defines its detailed behavior):<class>
or <objName>:<class>
. Without colon it's only the object name.Upvotes: 3