• 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: Inherited constructors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inherited constructors


  • Subject: Re: Inherited constructors
  • From: Ondra Cada <email@hidden>
  • Date: Thu, 30 Aug 2001 11:21:18 +0200

Drew,

>>>>>> Drew McCormack (DMC) wrote at Thu, 30 Aug 2001 09:26:21 +0200:
DMC> >I am quite afraid you are wrong in that.
DMC>
DMC> Whoa, the obj-C police are out in force today!

Stay cool, nobody forces you not to keep your wrong opinions ;)

As for init (actually, it applies for all other methods as well): we are in
OO world, and so we use inheritance. The thing says "an inherited class is a
(special) case of its superclass". One of many (good!!!) consequences is that

Class c=...
if ([c isKindOfClass:[MyClass class]])
[[c alloc] someInitDefinedInMyClass];

is quite valid, regardless c is a member of MyClass or its far descendant.

Non-inheritable constructors would therefore seriously harm OO, just as they
do in C++.

There is a plethora of other reasons why constructors as a special language
constructions are The Bad Thing, but I guess this one is sufficient.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc


References: 
 >Re: Inherited constructors (From: Drew McCormack <email@hidden>)

  • Prev by Date: Re: NSArchiver? try again
  • Next by Date: Re: Subject: Inherited constructors
  • Previous by thread: Re: Inherited constructors
  • Next by thread: Fwd: Inherited constructors
  • Index(es):
    • Date
    • Thread