Closed 3lvis closed 9 years ago
:+1:
How about data controller, not a view controller, how would you name it?
ImageController, FetchingController, etc
What's a data controller?
What would a ImageController do? Or a FetchingController? Do they subclass from UIViewController/UIPageViewController/UICollectionViewController/UITableViewController?
This issue refers to those subclasses.
HYPRecipesController for example could download and validate In-APP Purchase receipts
HYPRecipesController: NSObject - validate verecepts. Would use use controller suffix only for ViewControllers ?
I wouldn't name something like that a HYPRecipesController
. More something like HYPRecipeValidator
Would use use controller suffix only for ViewControllers?
I had that in mind. Usually anything else called Controller
is code smell.
Ok
Controller
's and Manager
's beware, you smell
I use Manager, it's bad? I agree with the Issue @3lvis! :)
Agree with @3lvis to drop ViewController
suffix, but we could be in conflict with Apple's naming then. For example NSFetchedResultsController
is not view controller, but has Controller
suffix.
As for managers I think Manager
is too generic, I would name it something like DataFetcher
instead of DataFetchManager
, but it's another discussion I guess.
The naming of NSFetchedResultsController
is just unfortunate, wouldn't take it as an example of good naming. It could be called NSResultsFetcher
or NSManagedObjectFetcher
.
Yes, NSResultsFetcher
is much better, but I mean that Apple did it for some reason and we can't change it :smile: .If you think that it's not very important to follow some Apple's name conventions, then we are Ok.
They have been quite inconsistent too.
UITabBarController
, UISearchController
, UINavigationController
, UIAlertController
, MPMediaPickerController
, EKCalendarChooser
for example, all of them subclass UIViewController
.
@hyperoslo/ios guys => https://github.com/hyperoslo/iOS-playbook/pull/131
I was thinking that we could just use
controller
. For example you have anHYPRecipesViewController
, you would only name itHPYRecipesController
or in Swift justRecipesController
.Is not that for subclasses of UITableViewController you do
RecipesTableViewController
, and even if you did that it's not a requirement since knowing the parent class isn't super difficult, meanwhile writing the super long name everywhere can be quite painful.tl;dr
HYPRecipesTableViewController
=>HYPRecipesController
What do you guys think @hyperoslo/ios?