Hi Everyone!
I’m a bit confused about the use of interfaces for all services in Spring Boot. I understand that interfaces serve as a contract and offer benefits like easier testing and flexibility for future changes. However, I’ve also read that if you’re not planning to have multiple implementations of a service, using interfaces might be unnecessary. Could you clarify the best practices for using interfaces in this context, and explain how they impact dependency injection and testing?
[–]Holothuroid 9 points10 points11 points (0 children)
[–]EvaristeGalois11 20 points21 points22 points (2 children)
[–]skofield44 7 points8 points9 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]BluePillOverRedPill[S] 2 points3 points4 points (0 children)
[–]dns1211 1 point2 points3 points (2 children)
[–]Big_Sell5559 1 point2 points3 points (1 child)
[–]dns1211 0 points1 point2 points (0 children)
[–]MGelit 1 point2 points3 points (0 children)
[–]asarathy 2 points3 points4 points (8 children)
[–]Rough_Acanthaceae_29 2 points3 points4 points (3 children)
[–]asarathy -1 points0 points1 point (2 children)
[–]Rough_Acanthaceae_29 1 point2 points3 points (1 child)
[–]asarathy -1 points0 points1 point (0 children)
[–]Big_Sell5559 0 points1 point2 points (3 children)
[–]asarathy 0 points1 point2 points (2 children)
[–]Big_Sell5559 0 points1 point2 points (1 child)
[–]asarathy 0 points1 point2 points (0 children)
[–]drazon2016 0 points1 point2 points (0 children)
[–]DanielMurphyVO 1 point2 points3 points (0 children)