25. Class Clusters

The Class Clusters pattern presents a simple interface to a complex underlying implementation. This pattern is usually used to shield application developers from the details of performance and storage optimizations provided by frameworks. The pattern provides a public class for use in application code, but when applications attempt to allocate instances of the public class, the framework actually provides instances of private subclasses of the public class. Frameworks use information supplied at runtime to select the appropriate private subclass on a case-by-case basis. The Class Clusters pattern is sometimes called the “Abstract Factory” pattern because the public class is abstract. This means instances of the public class ...

Get Cocoa Design Patterns now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.