go-clean-arch
go-clean-arch copied to clipboard
Questions About Whether Necessary To Use Pointer For Usecase
Thanks a lot for the repo and it is really informative. However I have two small questions about pointer and value for usecase.
- In this scenario, article usecase is using pointer in both constructor and method receiver, is it because of the repository dependency(sqldb) which is also a pointer?
- What if I have a simpler usecase which doesn't have dependencies of references, eg: repository and it's just used to do simple stateless calculations without extra pointer dependencies. For these kind of scenarios, may I use copies instead of pointers?
I would be very appreciated if you could clear some of my doubts.
Hi @fans3210
Yes, exactly, no need to use the pointer if needed. I haven't updated the repo for a while. I will check again and remove the unnecessary stuff here.
Thanks for pointing that out. 🙏🏻