• 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
Are polymorphic objects possible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Are polymorphic objects possible?


  • Subject: Are polymorphic objects possible?
  • From: Wade Tregaskis <email@hidden>
  • Date: Sat, 2 Nov 2002 17:37:48 +1100

Is it possible for an object to change at runtime what it appears to be, to the rest of the program? For instance, if I have two types of object, say WTFoo and WTBar, can I make another one under some name (WTMorphy, for example) which can pretend to be WTFoo & WTBar, as it likes? i.e. I get an instance of WTMorphy, tell it to be a WTFoo, then at some later point it changes itself to a WTBar?

I know this sounds strange, and I'm not pretending it's necessarily a good idea to ever actually do, but I'm curious if it's possible. I can think of a couple of instances where it might be worth testing this, depending on how well it can be done.

Wade Tregaskis
_______________________________________________
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.

  • Prev by Date: Sending an AE to select all
  • Next by Date: Re: Are polymorphic objects possible?
  • Previous by thread: Re: Sending an AE to select all
  • Next by thread: Re: Are polymorphic objects possible?
  • Index(es):
    • Date
    • Thread