How works an AspectBuffer?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How works an AspectBuffer?

Christian David
Hello NG,

I'm new to Dolphin Smalltalk, take my first steps with Ted's "Dolphin ST
Companion" and the eXtreme Programming Site on his homepage.

I found something weird, that I cannot get in my head (Chapter 4):

1. I've got the model (the Driver class in Ted's book) and the presenter
(DriverDialog).

2. The presenter tells the model (respectively the subjectCopy from the
aspect buffer via "aspectBuffer value"), that he wants to know, when the
name changes:


DriverDialogPresenter>>model: aDriver
    ...
    aspectBuffer value when: #nameChanged send: #updateName to: self.

DriverDialogPresenter>>updateName
    (self presenterNamed: 'name') value: self model name



Everything works fine. But why? For example I expected, that I have to ask
for the actual value of "name" that way (via subjectCopy, returned by the
#value Method):


(self presenterNamed: 'name') value: self model value name


because we're working on an AspectBuffer (self model). And I was right, i
got the actual value this way. I also followed the #aspectValue: method of
AspectBuffer and found me confirmed (again we work with subjectCopy...).


But I don't understand, why I also get the value for 'name' if I just ask
the AspectBuffer (resp. self model) - he actually has no #name method!

I thought the AspectBuffer does something like "rerouting" the messages to
his subjectCopy. Is that right? I haven't found any hint to that assumption
in the CHB.


So where is it implemented? Or better: How is it? Have I missed something?

Thx for any help.

Christian.


Reply | Threaded
Open this post in threaded view
|

Re: How works an AspectBuffer?

Andy Bower
Christain,

> But I don't understand, why I also get the value for 'name' if I just ask
> the AspectBuffer (resp. self model) - he actually has no #name method!

You don't understand .. neither does the AspectBuffer :-)

> I thought the AspectBuffer does something like "rerouting" the messages to
> his subjectCopy. Is that right? I haven't found any hint to that
assumption
> in the CHB.
>
> So where is it implemented? Or better: How is it? Have I missed something?

Take a look at AspectBuffer>>doesNotUnderstand:. You'll see that it does,
indeed, re-route messages to the subjectCopy.

Best Regards,

Andy Bower
Dolphin Support
http://www.object-arts.com
---
Are you trying too hard?
http://www.object-arts.com/Relax.htm
---


Reply | Threaded
Open this post in threaded view
|

Re: How works an AspectBuffer?

Christian David
"Andy Bower" <[hidden email]> schrieb:

> > But I don't understand, why I also get the value for 'name' if I just
ask
> > the AspectBuffer (resp. self model) - he actually has no #name method!
>
> You don't understand .. neither does the AspectBuffer :-)
>
> > I thought the AspectBuffer does something like "rerouting" the messages
to
> > his subjectCopy. Is that right? I haven't found any hint to that
> assumption
> > in the CHB.
> >
> > So where is it implemented? Or better: How is it? Have I missed
something?
>
> Take a look at AspectBuffer>>doesNotUnderstand:. You'll see that it does,
> indeed, re-route messages to the subjectCopy.

Sometimes its so simple :-) Thx alot.

Christian