-
Notifications
You must be signed in to change notification settings - Fork 495
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
ViewModelType protocol and associatedtype limitations #38
Comments
Hi, @IvanKalaica, thanks for the question :) What benefits do you think we would get from using
Curious to see an example :) |
I think interface based programming is always a good habit. :)
|
@IvanKalaica Could you explain more why the below code is good habit? |
@sergdort as per Dependency Inversion Principle (DIP) when 2 classes or modules are communicating with each other than both should link to abstraction rather than knowing about concrete module/class, which makes the system loosely coupled. |
Should't PostsViewModel be an protocol and not class? I think keeping protocol oriented view models is better than enforcing generic structure with associatedtype. Input/output transform can always be enforced per viewModel protocol. Thoughts?
The text was updated successfully, but these errors were encountered: