[PEAK] PyProtocols --
Gabriel Jägenstedt
gabriel.j at telia.com
Mon Feb 16 22:27:48 EST 2004
On Mon, 16 Feb 2004 18:05:04 -0500
"Phillip J. Eby" <pje at telecommunity.com> wrote:
> IComposite was supposed to be an interface that you would define that
> means that an object is composed of parts, i.e. has a 'parts'
> attribute and whatever other things you might want a composite object
> to do. It's not an existing interface anywhere that I know of.
ahh =)
> No, it's a strange word for "class". :) The first parameter of a
> classmethod is the class it's being called from. So, for the
> following:
oh hehe...
> Oops. The last line of 'invoke()' should read:
>
> return getattr(first,methodName)(chain,commandObj)
>
> That is, the 'return' was missing
just as I was guessing then, good, this means I might be able to grasp
this eventually.
> Actually, the design as I described it has no adapters *at all*. You
> simply declare that a component implements something, if it implements
> something. That's not an adapter.
It's just me using words I don't know, it really is components I'm
talking about, just not sure about all terminology yet.
> That's a rather silly example, but I just want to show where you'd be
> more likely to have an actual adapter, as opposed to just assembling
> composites by using components.
Oh it's silly, but still quite intruiging. I'll have to think about good
areas of use for this.
> Huh? You've completely lost me. You define an interface for each
> group of related actions you need to carry out. And you define a
> component for each specific behavior(s) you want, like creating a
> "lock" component that can be added to doors or books or whatever you'd
> like to be able to lock.
Don't worry bout it.. I tend to do that.. thanks for all your good
examples. I'm quite sure I'll be back in time, asking more stupid
questions =)
cheers
--
//gabriel - a true believer
More information about the PEAK
mailing list