Den 14:33 7. mars 2012 skrev Per Bull Holmen <pbhol...@gmail.com> følgende: > Den 23:48 6. mars 2012 skrev Conrad Shultz > <con...@synthetiqsolutions.com> følgende: > >> Personally, I try to the maximum extent possible to make properties be >> of immutable types for exactly this reason. It allows you to centralize >> management of locking/synchronization thus wipe out a whole category of >> potential bugs. It also allows for, e.g., easier KVO and generally >> simpler code. > > I agree. While making data graphs immutable is no guarantee of thread > safety, it is still a good practice which (usually) can make it easier > to achieve thread safety, performance, maintainability etc...
Sorry, I need to claridy that: It may not always be the best thing to make entire data trees immutable, that depends on the problem at hand, but exactly as Conrad Shultz says, make properties be of immutable types. Per _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com