• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Abstract classes and methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Abstract classes and methods
      • From: Georg Tuparev <email@hidden>
References: 
 >Re: Abstract classes and methods (From: "Michael B. Johnson" <email@hidden>)

  • Prev by Date: speed daemons
  • Next by Date: Re: Abstract classes and methods
  • Previous by thread: Re: Abstract classes and methods
  • Next by thread: Re: Abstract classes and methods
  • Index(es):
    • Date
    • Thread