Re: Outline and Table back to front
Re: Outline and Table back to front
- Subject: Re: Outline and Table back to front
- From: Ben Kazez <email@hidden>
- Date: Mon, 20 Jun 2005 16:15:06 -0400
From a technical standpoint, the inheritance could go either way --
NSTableView is a specialized NSOutlineView, or vice versa. The choice
should be made based on what makes most sense from an implementation
standpoint. Look at the two options:
- NSTableView is a specialized NSOutlineView. (This means NSTableView is
a subclass of NSOutlineView.) With this way of thinking, an NSTableView
is an NSOutlineView that cannot display outline data.
- NSOutlineView is a specialized NSTableView. (This means NSOutlineView
is a subclass of NSTableView.) With this way of thinking, an
NSOutlineView is an NSTableView that can display outline data.
Removing a feature from a class would mean overriding the applicable
methods with empty stubs and ignoring member variables. This is wasteful
of memory and confuses the user of the subclass, who has to know not to
use the methods that are empty. On the other hand, adding a feature to a
class is usually a reason given for subclassing. This would explain why
NSOutlineView inherits from NSTableView.
In fact, the entire Cocoa inheritance tree works this way. We don't have
NSImageViews that are NSViews that are NSImageViews without built-in
image-viewing capabilities; to implement this would require tons of
multiple inheritance (picture the inheritance tree upside down!).
Ben
--
Ben Kazez
iCal Events Developer
http://www.benkazez.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden