[Q] Inheritance, Composition and Abstract super classes
[Q] Inheritance, Composition and Abstract super classes
- Subject: [Q] Inheritance, Composition and Abstract super classes
- From: "Peter.Teeson" <email@hidden>
- Date: Sun, 23 May 2004 20:52:45 -0400
In the new Cocoa Document app I am designing I have a situation where
it seems to me better to use an "abstract" super class and inheritance
rather than composition (usually the better approach).
As a simple example of what I mean consider bookeeping:
Accounts Receivable and Accounts Payable both need to maintain contact
data on a company's address, phone, fax, ship to etc.
To me inheritance from an "abstract" super class makes sense for that
example. Then the child classes can add specific behaviours as desired.
Now consider the MyDocument class as the "abstract" class and consider
two or three child classes inheriting from it.
My questions are:
(0) Should any of the MyDocument definitions of overridden methods be
commented out?
(1) If a method that is overridden in the MyDocument class is also
overriden in one of the child classes is my understanding correct that
it is the child class that receives the message and that the super
class method will NOT receive it unless explicitly invoked from the
child class?
TIA for your comments.
respect...
Peter
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.