-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RealtimeChannel: duplicated publish
method
#127
Comments
Agreed that #121 should be fixed first |
I think the deeper problem is, why is RealtimeChannel inheriting from RestChannel? You can't use a RealtimeChannel as a RestChannel. If anything, both should inherit from a BaseChannel or implement a Channel protocol. I strongly think that this should be fixed. |
This is mostly because they share functionality such as |
To reuse code, it is a very well-established "principle" to use composition over inheritance. Anyway, to not get sucked into the rabbit hole, I would be happy with inheriting from a BaseChannel. |
Sure, we do that in our Ably libraries. If that's easy enough to do in Objective-C, sure, although I suspect we're largely using inheritance elsewhere |
Yes, it is largely using inheritance, e.g.: @tcard So you mean something like |
@ricardopereira I guess. Or even RealtimeChannel having a RestChannel property, because AFAIK RealtimeChannel just calls the REST API for history, right? |
Yes, you right. |
Fixed by 97f0b16. |
Code completion:
The
RestChannel
is the base class of theRealtimeChannel
.RestChannel
has 4 publish methods that we already discussed on #121.Problem:
The
RealtimeChannel
does not override those methods and use their own. It should override them and avoid calling the super implementation.IMO, we should fix #121 first.
The text was updated successfully, but these errors were encountered: