Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!nntp.club.cc.cmu.edu!godot.cc.duq.edu!newsfeed.pitt.edu!gatech2!news.mathworks.com!tank.news.pipex.net!pipex!sunsite.doc.ic.ac.uk!susx.ac.uk!news.bton.ac.uk!Simon.Shurville
From: sjs16@itri.bton.ac.uk (Simon John Shurville)
Subject: Re: self subclassResposibility
X-Nntp-Posting-Host: tomcat.itri.bton.ac.uk
Message-ID: <DIsxo5.L8p@bton.ac.uk>
X-Posted-From: InterNews 1.0@diamond.bton.ac.uk.
Lines: 21
Sender: -Not-Authenticated-[3206]
Organization: The Composer Project
References:  <MM.817456327.27003.gyda@ifi.uio.no>
Date: Wed, 29 Nov 1995 11:09:41 GMT
Xdisclaimer: No attempt was made to authenticate the sender's name.

In article <MM.817456327.27003.gyda@ifi.uio.no>
SI/TASKON <taskon@ifi.uio.no> writes:

> Subclassresponsibility is really nifty for abstract classes, classes that
> are never meant to be instansiated, just to be subclassed.
> 
> An example: Class OS implements the methods executeString: , hostname ,
> checkIfFileNameIsLegal. All these method just says self subclassResponsibility.
> When you port your application to Amiga, you create your own OS subclass called
> AmigaOS. Then you know you have to implement all methods in OS that calls
> subclassResponsibilty, like hostname and checkIfFileNameIsLegal. If you have not,
> then the image gives you a nice errormessage, it does not barf out.
> 
> A nice, programmerfriendly touch.

Thanks, I was reading Booch last night and I wondered this self same
thing.  Previously I had written methods that just returned the same
value at the abstract level or which did nothing. E.g., tidyFormat:
someStringConvertedFromANumber at an abstract level this just returned
someStringConvertedFromANumber. Then, at a level where I am converting
fixed point numbers to strings, it strips of the pesky f that
VisualWorks leaves in when one converts a FP to a string (I'm sure
there is a better way around this but I am a novice). I'll look in to 
Subclassresponsibility now because it makes it nice and clear that
something is deferred. Once again thanks for taking the time.

