4. The very first Objective-C design pattern

This design pattern can’t be attributed to Cocoa or NeXTStep because it predates them both. In their introductory book on Objective-C, Brad Cox and Andrew Novobilski described a packaging technology for software that they called “software ICs”. Patterned after the integrated circuits that were commonly sold off-the-shelf and designed into electronic systems in the mid-1980’s, a software IC was a moderately complex software component with a very well-specified interface and the ability to bind that interface to other components at runtime.

Objective-C’s message passing system was designed to be the interconnection technology for software ICs. Presumably, because the components and their interfaces were so well-defined, software ICs could be sold and distributed as binary implementations… without source code!

Many software projects today are built by reusing third-party components, but many programmers now prefer to use open-source components. One reason for that is how historically hard it’s been to integrate third party subsystems. I think that’s a result of decisions made in the 1990’s about implementation technologies—preferring performance over flexibility, developers used languages and technologies that produced very brittle assemblies. Today countless programmers stumble under the weight of those systems.

Cocoa is notably not an open-source framework. Although many of us wish that it were (yes, it has more than a few obscure interfaces and hastily-assembled components), programmers have used it with remarkable success. The flexibility and modularity of Objective-C’s message passing system make it a a key element of that success. And we can bet that those characteristics have more than once saved Apple from collapsing under the weight of its own code.

Did you find an error? Is something missing? Post your comment or suggestion below!

Comments (0) post