Is it a good pattern that no objects should know more than what it needs to know?
Posted
by
Jim Thio
on Programmers
See other posts from Programmers
or by Jim Thio
Published on 2012-05-30T15:54:32Z
Indexed on
2012/05/30
16:59 UTC
Read the original article
Hit count: 299
programming-practices
I am implementing a viewController class. The view controller class got NSNotification when the Grabbing class start or finish updating.
I have 2 choices.
I can make the grabbing class to provide a public read only property so all other classes can know whether it is still uploading.
Or I can let view Controller to listen to 2 different events. Start updating and finish updating events.
The truth is the viewController do need to know whether the grabbing class is still updating or not at any other time.
So I am thinking of creating 2 events would be a better way to go.
Actually, what do you think>?
© Programmers or respective owner