Re: Abstract classes and methods
Re: Abstract classes and methods
- Subject: Re: Abstract classes and methods
- From: Carlos Weber <email@hidden>
- Date: Wed, 29 Aug 2001 19:23:14 -1000
On Wednesday, August 29, 2001, at 07:40 , Michael B. Johnson wrote:
guess we'll agree to disagree, but it would be nice to hear from others
on this.
Michael, this is a little late, but you did say you wanted to hear from
someone other than Ondra...
I'm a relative newcomer to Cocoa/ObjC, but here's an example from my
limited experience involving the NSTableView class. I have an app in
which there's a table view, but it was read-only. So, in the object I
designated as the table's data source, I implemented only two of the six
methods in the (informal) protocol, to wit, the -numberOfRows... and
-tableView:objectValueForTableColumn:row: methods. I didn't need the
-tableView:setObject... or the drag/drop-related methods. If these
methods were implemented as formal protocols (conformance to the
protocol requiring implementation of ALL the methods) it seems to me
that at least three formal protocols would be required to cover all
situations (maybe more). So you would end up trading protocol
proliferation for a little help from the compiler. I'm not dogmatic
about this, but I think I prefer it the way it is.