Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol Discussion incorrectly associates Protocols with Abstract Classes #5

Open
quellish opened this issue Jul 12, 2014 · 0 comments

Comments

@quellish
Copy link

In the section on protocols, the book states:
"A great miss in the Objective-C world is the outcome of the latest decades about abstract interfaces. The term interface is typically used to refer to the .h file of a class but it has also another meaning well known to Java programmers which is basically used to describe to a set of methods not backed by a concrete implementation. "

This is not accurate. In objective-c class clusters provide abstract interfaces (and are, usually, abstract factories). NSString, NSNumber, etc. are all abstract interfaces implemented as class clusters. Several framework classes allow specific class clusters to be extended at runtime (NSURLProtocol, etc.).

https://developer.apple.com/library/ios/documentation/general/conceptual/devpedia-cocoacore/ClassCluster.html

In contrast, a protocol only defines a set of messages that an object can choose to implement.

https://developer.apple.com/library/ios/documentation/general/conceptual/devpedia-cocoacore/Protocol.html#//apple_ref/doc/uid/TP40008195-CH45-SW1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant