On Jun 20, 2005, at 4:56 PM, Jesus De Meyer wrote: Squares are restricted rectangles, therefore they are subclasses of rectangles. Numbers are restricted objects, therefore they are subclasses of objects table views are restricted outline views, therefore they *should* be subclasses of outline views
No, the whole idea of subclassing is to start with a basic object (the root) and then subclass it to add more functionality to the object.
Think about an NSArray. NSMutableArray is a subclass of NSArray, because it adds the ability to add, insert and remove object, which the original object (NSArray) couldn't do.
Absolutely not - from a theoretical perspective, the object is all powerful... everything is an object, i.e. objects can do everything...
Numbers are objects - they are objects that restrict the functionality of an object to such things as adding up etc. but exclude the ability to do string concatonation.
String is not a subclass of number specifically because it does things that numbers do not do.
Think about how you write subclassing... A number "is an" object, an object is not necessarily a number.
A table view "is an" outline view in that you can describe all table views in terms of being an outline view.
An outline view is not a table view because I can give you an example of an outline view that is not a table view.
Bob |