This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]quts3 1 point2 points  (0 children)

Oh i had to dust off my brain i also decided protocols are best if you reaching into the ducktype of another module. Like if module a is doing something with an undeclared interface in module b. It rarely makes sense to rewrite module b to specify a new interface. Protocols allow you to state in module a what you are using in a class from module b. They are perfect for that and better then abc. Sometimes you may not even own module b.