On Tue, 06 May 1997 12:42:40 GMT, mc...@cam.ac.uk (Martin Harvey) wrote:
>Verily, Edward McSweeney <emcswee...@NO-TRASH.mayo.edu> spake thus:
>>Does anyone know of any good books (the simpler, the better)
>>that describe the process of creating and coding objects?
>>I ask this because I come from a background of procedural
>>programming. When I use Delphi I get the distinct feeling
>>that I'm missing out on a large part of the power that
>>the language has to offer. However, I'm out of school
>>and don't have the time or money to go back and get a
>>formal education in object-oriented programming.
>>In other words, I'm not looking for a Delphi book so much
>>as I'm looking for a general introduction and tutorial for
>>object-oriented programming. How does one approach a
>>programming problem using objects, and how does one design
>>and build objects and the interactions between objects prior
>>to writing a single line of code?
>>If anybody knows of a good resource for this type of study,
>>would you mind sharing it? Thanks.
>I agree in that if you don't yet have the hang of OO programming,
>you're missing the part of the language where you can have your cake
>and eat it!!
>I can't think of any particularly appropriate books that haven't
>already been mentioned, but I've found that it's often a good idea to
>write little demo programs which use OO... and then think about how
>you wrote them, and rewrite them a different way using more / less OO.
>eg:
>I wrote a communications interface which posted newsgroup articles via
>TCP/IP ... it had the article header objects, article body objects,
>group objects, and list objects which would contain lists of any of
>the above.... all very nice, but I had an object that "unpicked" the
>other objects in order to send them.... the "procedural way"...
>once you've done something like this you often realise that you're
>doing something wrong when the coding gets rather repetitive. Often,
>when starting to write OO programs (or if like me you didn't have a
>clear enough concept of what you wanted to do in the first place),
>it's a good idea to just rewrite one, twice (or even three) times,
>just to get a fell of all the different options that OO allows you...
>A Good case-study that you can have a go at is:
>Implement a logical "spreadsheet cell", which can contain either text
>integers or floating point,
>eg TCell
>and then derived, TIntegerCell, TRealCell, TStringCell.
>(Logical = non visible).
>Devise conversion routines to create one sort of cell when given
>another as a parameter.
>Devise routines to make a carbon copy of a cell. (virtual method that
>is overridden?)
>Devise routines to make a cell display it's output (another virtual
>overriden jobbie).
>Devise routines that will take two cells and add them to create a
>third cell... being in mind you need to type check the first two cells
>and decide what sort of a cell you want to make given them:
>eg Add(a,b:TCell):TCell
>Some of the rules might be:
>TIntegerCell+TRealCell=TRealCell
>TCell+TStringCell=TStringCell
>etc etc...
>If I remeber rightly this was an example exercise I rather liked when
>starting out OO programming... I'll see if I can find you the details
>:-)
>Martin H.
>***********************************************
>Martin Harvey
>Uni email: mch24@remove this.cam.ac.uk
>Home email: mch24@remove this.harvey27.demon.co.uk
>Uni web pages: http://www-stu.pem.cam.ac.uk/~mch24/
>Remove appropriate bits from my sig to reply to me
>(The junk mail is driving me barmy).
>***********************************************