Re: Abstract classes and methods
Re: Abstract classes and methods
- Subject: Re: Abstract classes and methods
- From: Georg Tuparev <email@hidden>
- Date: Thu, 30 Aug 2001 08:32:57 +0200
I too think Michael has spoken too soon. I'm sure he himself never fully
implemented all NSWindows or NSApplication delegate methods. But there
are many places where formal protocols are a necessity. Every time an
object should behave like a good citizen in the community of domain
related objects protocols work best. Another classical example are
remote objects in distributed systems...
On Thursday, August 30, 2001, at 07:23 AM, Carlos Weber wrote:
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.
Georg Tuparev
Tuparev Technologies
Klipper 13
1186 VR Amstelveen
The Netherlands
Mobile: +31-6-55798196