Classes and Inheritance
Vandendriessche, Frederik
frederik.vandendriessche at eds.com
Wed Jun 23 08:49:48 UTC 1999
Hi,
I am writing three classes;
AbstractwebApplication
this class has a method called initialize, which calls
initializeRequestHandlers, (and does some other stuff).
The initializeRequestHandlers method is the responsibility of my
subclasses.
this class implements
intialize
self intitalizeRequestHandlers
webBoaApp
this class has a var called RequestHandlers*
this class implements
initializeRequestHandlers
self requestHandlers at: nil put: [:aRequest | self
openApplicationFor: aRequest ].
webUrlApp
this class has a var called RequestHandlers*
this class implements
initializeRequestHandlers
self requestHandlers at: nil
put: [:aRequest | self showUrlListFor: aRequest ].
Now, I have the strangest effect (at least I think it is strange/not normal)
;
After doing
webBoaApp initialize.
webUrlApp initialize.
only webBoaApp's class var Requirements is filled out ! With the
requestHandlers of webUrlApp ! (They overwrote the webBoaApp
requestHandlers).
How comes ??? I do not know how to put this in english, but my first
thought was 'The inheritance only works for instances' ?
Can anyone give me some pointers on what I am doing wrong ?
Many thanks in advance.
* First, I tried using one class var RequestHandlers, in the AbstractWebApp
class, and it did not work.
then i started moving the class var to the subclasses that will fill out the
var, but the strange effect stays...
Frederik Vandendriessche
System Engineer,
Electronic Business Services,
* frederik.vandendriessche at eds.com
* ..32/0 2 711 37 83
L ..32/0 2 711 39 47
"The best way to predict the future is to invent it." Alan Kay
More information about the Squeak-dev
mailing list
|