Over the course of a few projects, I have written a decent amount of class factory methods for accessing a Singleton instance of a class. I have always used some variation on the + (id)sharedSomething;
naming convention.
Apple, on the other hand, has a variety of naming conventions. For example:
// NSNotificationCenter
+ (id)defaultCenter;
// NSUserDefaults
+ (NSUserDefaults *)standardUserDefaults;
// UIApplication
+ (UIApplication *)sharedApplication;
Is there any rhyme or reason to the adjective placed before the noun in those names that I should be aware of when naming my own methods? I originally thought it might have something to do with "flexible" vs "strict" singleton designs, but NSFileManager and NSNotificationCenter both follow the + (id)defaultSomething convention, yet NSFileManager supports the allocation of other instances while NSNotificationCenter does not. I'm stumped.
EDIT: I was wrong in thinking NSNotificationCenter does not support the instantiation of new centers. It's just not terribly common, so the original hypothesis is not necessarily invalidated.