-
Notifications
You must be signed in to change notification settings - Fork 2
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
RazrabsApi now use protocol, host/scheme are private fields #3
base: main
Are you sure you want to change the base?
RazrabsApi now use protocol, host/scheme are private fields #3
Conversation
@fnc12 |
class RazrabsApi { | ||
let scheme: String | ||
let host: String | ||
final class RazrabsApi: PRazrabsApi { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
зачем final
?
// Created by Anatoliy on 23.08.2022. | ||
// | ||
|
||
protocol PRazrabsApi { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я бы назвал протокол RazrabsApi
, а реализацию RazrabsApiImpl
. Однобуквенные сокращения это ужасно для читаемости
let host: String | ||
final class RazrabsApi: PRazrabsApi { | ||
private let scheme: String | ||
private let host: String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
зачем приват?
@VAnatoliy к чему такая спешка в оборачивании API в протокол? |
RazrabsApi.scheme - можно сделать константой, вряд ли будет использовано http
RazrabsApi.host - лучше вынести в билд сеттингс приложения, чтобы можно было разделить dev/stage/prod инстансы апки в дальнейшем.