Is it okay to have extra static methods in a singleton class?

38 Views Asked by At

I have written a singleton class (in objective-C) with methods:

//shared instance
+(void) sharedInstance;

//method to get all feeds.
-(NSArray*)getAllFeedItems;

So to use this I have to call [[MyClass sharedInstance] getAllFeedItems];

Now instead of that if I define a static method:

+(NSArray*)getFeedItems;

which in turn implements:

+(NSArray*)getFeedItems{
  return [[MyClass sharedInstance] getAllFeedItems];
}

So that now I can simply use: [MyClass getFeedItems];. Is there anything wrong in doing so? will it cause any issues or is it bad coding practice? For me it was just making the function Call easier.

0

There are 0 best solutions below