• 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: obj-c functions versus class methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: obj-c functions versus class methods


  • Subject: Re: obj-c functions versus class methods
  • From: Mark Eissler <email@hidden>
  • Date: Sat, 13 Mar 2004 12:13:49 -0500

First, I'd like to thank those that replied to my post.

Second, I'd like to clarify that the fact that a plain C function is independent and cannot be extended through OOP isn't a concept that I simply forgot. Rather, that wasn't the point of my question. I think it is often quite clear (under normal circumstances) when an object oriented design is beneficial versus functional decomposition.

With obj-c the question of plain C versus a class method should probably consider the overhead to instantiate a class and the necessary exposure of symbols in the binary. Other than those two issues, I can't seem to see if there is a difference between the two other than preference and portability issues. What am I missing?

-mark


On Mar 10, 2004, at 8:16 PM, Philippe Mougin wrote:

Class methods, like instance methods, differ from plain C functions in that they allow us to use that particular style of programming we call "object-oriented". In particular, class methods support polymorphism and dynamic-binding, which in turn allows for object-oriented programming whereas plain C functions do not. Remember that, in Objective-C, classes are themselves objects. Thanks to class methods (which are in fact instance methods of meta-classes), you can make use of polymorphism and dynamic binding when interacting with classes.

Best,

Philippe Mougin


--
Mark Eissler, email@hidden
Mixtur Interactive, Inc.
_______________________________________________
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: obj-c functions versus class methods
      • From: Patrick Machielse <email@hidden>
References: 
 >Re: obj-c functions versus class methods (From: Philippe Mougin <email@hidden>)

  • Prev by Date: Re: CFM Libraries
  • Next by Date: Re: NSString really Unicode?
  • Previous by thread: Re: obj-c functions versus class methods
  • Next by thread: Re: obj-c functions versus class methods
  • Index(es):
    • Date
    • Thread