• 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
[Q] Inheritance, Composition and Abstract super classes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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.


  • Follow-Ups:
    • Re: [Q] Inheritance, Composition and Abstract super classes
      • From: Chris Hanson <email@hidden>
    • Re: [Q] Inheritance, Composition and Abstract super classes
      • From: Joakim Danielson <email@hidden>
  • Prev by Date: Re: build standalone app
  • Next by Date: Setting NSImageView back to default
  • Previous by thread: Re: build standalone app
  • Next by thread: Re: [Q] Inheritance, Composition and Abstract super classes
  • Index(es):
    • Date
    • Thread