Shout Workspace by Default

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

Shout Workspace by Default

Zulq Alam-2
I want to have all Workspace instances actually be instances of its
subclass SHWorkspace. I'm not sure about which way is advisable. My
first thought was:

Workspace>>new
   ^ SHWorkspace new

SHWorkspace>>new
   ^ self basicNew initialize

This works but it doesn't feel right. Especially when I can get away with:

Workspace>>new
   ^ SHWorkspace basicNew initialize

You wisdom would be appreciated.

Oh, and isn't there something wrong with:

Behavior>>new
   ^ self basicNew initialize

Shouldn't it have a yourself? Otherwise it relies on initialize
answering with self and it would seem often the implicit self. Perhaps
this is intended for some reason?

Thanks,
Zulq.





Reply | Threaded
Open this post in threaded view
|

Behavior>>new ^ self basicNew initialize [was: Shout Workspace by Default]

Klaus D. Witzel
On Mon, 11 Sep 2006 02:15:39 +0200, Zulq Alam wrote:
...
> Oh, and isn't there something wrong with:
>
> Behavior>>new
>    ^ self basicNew initialize
>
> Shouldn't it have a yourself? Otherwise it relies on initialize  
> answering with self and it would seem often the implicit self.

Try this: YourClass>>initialize ^nil

> Perhaps this is intended for some reason?

Yes, Behavior doesn't want to take over the responsibility for what is  
returned by your #initialize method, so it passes garbage-in garbage-out.

If in need, you can always ask for (YourClass basicNew initialize;  
yourself).

/Klaus

> Thanks,
> Zulq.
>
>
>
>
>
>