Skip to content
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

Simplifying usage of TypesFactory class #3

Open
yeduRaghav opened this issue Mar 12, 2018 · 1 comment
Open

Simplifying usage of TypesFactory class #3

yeduRaghav opened this issue Mar 12, 2018 · 1 comment

Comments

@yeduRaghav
Copy link

yeduRaghav commented Mar 12, 2018

Hi,
First of all thank you for putting up the sample.
I have been going through your example and I have a feeling that the TypesFactoryImpl class could be a regular factory, with static factory methods. Therefore, it's instance don't need to be held by Adapter.

Unless I missed a big point

@dmitrikudrenko
Copy link
Owner

Hi, @yeduRaghav
Yeah, you are right. It is possible to remove TypesFactory, make TypesFactoryImpl Kt-object and use it directly. But according to dependency inversion principle it would be better to use interface+implementation and send it to adapter (in the sample I create it, but I should use TypesFactory in adapter constructor).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants