mercredi 6 septembre 2017

Why does SonarJava mark delegation pattern as duplicate code? Isn't this bad advice

I've have read over and over that you should prefer delegation over inheritance, yet anytime I use the delegation pattern to implement an interface, in more than one class, SonarQube marks the code as duplicates. The only way I can see avoiding the duplication is by using inheritance.

This seems like really bad advice. Is there any way to convince SonarQube that it's wrong here?

Can someone from the SonarJava team explain why they would want to encourage such tight coupling?

Aucun commentaire:

Enregistrer un commentaire