简体   繁体   中英

Difference between class clusters and abstract factory in cocoa

I have read that Obj-C class clusters are an implementation of the abstract factory .

Can anyone explain if there are any differences between the 2 as design patterns. I read somewhere that there are certain restrictions on class clusters that don't apply to traditional abstract factory but it did not give more details.

Most of the limitations concern attempting to modify the Foundation class clusters rather than those you may write on your own. For example, subclassing NSDictionary (which is a Foundation class cluster) can lead to some interesting problems.

You are free to implement your own class clusters, which is fairly easy and can have a high payoff. A class cluster is a type of abstract factory .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM