Re: obj-c functions versus class methods
Re: obj-c functions versus class methods
- Subject: Re: obj-c functions versus class methods
- From: Philippe Mougin <email@hidden>
- Date: Thu, 11 Mar 2004 02:16:26 +0100
> In the grand scheme of things, what is the practical difference
> between implementing functionality in a plain C function versus
> an obj-c class method? Don't they accomplish the exact same thing
> except the latter associates the functionality very specifically
> with a particular group of functionality?
>
> -mark
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
_______________________________________________
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.