Closed vadymmarkov closed 9 years ago
@vadymmarkov @RamonGilabert I believe that protocols is the way to go, even if that might be a bit odd in terms of lack of optionals. Just my 50 cents.
I feel right now it's a bit strange to have (if we go for the first option) user.user, or post.post, although I feel that the second way it's not that bad. Swift is protocol oriented, and as yesterday discussed with Chris, we're going to use Swift 2.0 in this project, apparently, I think is the way to go...
@zenangst @RamonGilabert Ok, then we'll go with the second way. What do you think is the best name for protocols, something like PostConvertible
? Don't want to name it just Post
, it's not protocol naming style and could cause conflicts with class names in the actual project.
@vadymmarkov Postable
, Feedable
. I kinda like the -able suffix.
We see if quiet a lot in Swift right, Comparable
, Equatable
and so on?
Am I right? @RamonGilabert
@vadymmarkov was actually suggesting an able suffix, but I like more the one word naming for Models!
@zenangst @RamonGilabert It works for Post
, but what about other classes? Userable
, Attachable
, Groupable
, Imagable
, Videoable
:smile: ?
@vadymmarkov @RamonGilabert Some of them are actually in the English dictionary :sunglasses: I think it works.
Attachable : to attach a photograph to an application with a staple. Groupable : able to be grouped
Userable is horrible in my opinion though... And Imagable and Videoable also horrible... What do you think?
@RamonGilabert
Imageable : Capable of being imaged.
@zenangst let's do it then, but userable also?
Could you go for something like;
Attachment
-> Attachable
Group
-> Groupable
Image
-> Displayable
Video
-> Playable
User
-> Profileable
@vadymmarkov @RamonGilabert thoughts?
Getting nicer over here! :)
Looks good now!
Was playing with this a bit and the first thing I've tried was a protocol like this:
Such kind of protocols could be used for every model we have, but I don't really like that
Post
knows about it:Also with this approach we should use
post.post
,user.user
everywhere and it looks not very nifty as for me.Another option is to convert current Wall models to protocols, but if our model that implements this protocol doesn't need to have
title
for example, we have to add it anyway, like:@zenangst @RamonGilabert Any thoughts?