Drop "get" prefix on getters
Reported by Scott Guelich | February 6th, 2009 @ 11:38 PM | in ObjectiveResource 1.1
Classes like ObjectiveResource and the NSObject methods use the "get" prefix for their getters. Although this is a common idiom in some languages like Java, the "get" prefix is always omitted in Cocoa except in a very specific case. From Apple's coding guidelines:
Use "get" only for methods that return objects and values indirectly. You should use this form for methods only when multiple items need to be returned.
So methods like "getRemoteId" and "getRemoteSite" would be better as "remoteId" and "remoteSite". Things like Key-Value-Coding also depend on this convention. Setters do use the set prefix, so they can stay as is.
References: * http://developer.apple.com/docum... * http://cocoadevcentral.com/artic... * http://cocoadevcentral.com/artic...
Note: I'm insanely impressed by this project and eager to try it out down the road. So this ticket is filed with the intention of helping make ObjectiveResource more intuitive and natural to use... not to nitpick. :)
Comments and changes to this ticket
-
Joshua Vickery February 8th, 2009 @ 11:16 AM
- Milestone set to ObjectiveResource 1.01
Excellent point.
-
jjburka February 9th, 2009 @ 05:28 PM
- Assigned user set to jjburka
-
Joshua Vickery February 10th, 2009 @ 04:16 PM
James -- we need to be careful with this one because it will mean a change to the API. We should either hold off on this (maybe have a 1.01 bugfix build in the meantime) or figure out a way to handle this gracefully.
-
Joshua Vickery February 10th, 2009 @ 04:19 PM
- Milestone changed from ObjectiveResource 1.01 to ObjectiveResource 1.1
-
jjburka February 16th, 2009 @ 10:03 AM
- Assigned user cleared.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Port of Rails' ActiveResource framework to the iPhone.