I write my application (obj-c) and i have created a very rigid class hierarchy.
Every class know less or nothing about others class and how those class manage their data.
Now i need create a log file with a full description of the activity, but because none class know the “full” process, none class can write a “full” log.
I’m looking for a design patter or best practice to share information among classes without sharing lot of details.
I hope my english was understandable.
I think knowing each class about others may not be good practice for you. In that way, your classes will become more and more dependent each other, which contradicts of the many design principles and breaks the modularity of your code.
I would add another module for your log activity, giving the ability of knowing about all the process, will give you the power about logging. This method is easy and simple enough to implement. Moreover, you can take a look at Aspect Oriented Architecture and Aspect-oriented Programming, which gives you to power of seperating the corss cutting concerns(logs in your case). you should check AspectCocoa and AOP-in-Objective-C