Is this considered black magic?

Christian Tanzer tanzer at swing.co.at
Tue Nov 13 02:19:09 EST 2001


"Scherer, Bill" <Bill.Scherer at VerizonWireless.com> wrote:

> > > UML refers to methods as 'operations', and the uncallable
> > > attributes as 'attributes'...
> > 
> > I don't know UML, but I suspect this is a different distinction.  Consider:
> > 
> > class Widget:
> >   def __init__(self, callback): self.callback = callback
> >   def go(self): return self.callback()
> > 
> > Would a Widget's 'callback' attribute really be considered an 'operation' in
> > this context?
> 
> Good point. No, I suspect it wouldn't.  It would probably be 
> indicated on a class diagram via an association to the class 
> that implements the callback, where it would be an operation.  I 
> don't know what they call that, but I suppose it's a 'delegated 
> operation' or 'aggregated operation'

Too bad that there isn't any class to point at. The very reason for
the callback is that you don't want to know which classes implement
it. 

Just another reason why UML sucks <0.1 wink>

-- 
Christian Tanzer                                         tanzer at swing.co.at
Glasauergasse 32                                       Tel: +43 1 876 62 36
A-1130 Vienna, Austria                                 Fax: +43 1 877 66 92





More information about the Python-list mailing list