I am confused. The solution said that favor loose coupling and the conclusion favor dependency on to the interface. But in the wrong example, MyDomain class depends on interface and in the right example it depends on class.
Learn something new every day.
- I am a senior software engineer working in industry, teaching and writing on software design, SOLID principles, DDD and TDD.
Location
Buenos Aires
Education
Computer Science Degree at Universidad de Buenos Aires
I am confused. The solution said that favor loose coupling and the conclusion favor dependency on to the interface. But in the wrong example,
MyDomain
class depends on interface and in the right example it depends on class.Maybe it is swapped?
thank you very much for pointing it out
last minute change. :)
Of course coupled.java was the wrong one!