Closed pfichtner closed 2 years ago
You make a good point. I was just looking at the other language versions and most have it private or protected. Package level privacy in Java is really quite permissive! I'd accept a pull request to make it protected, if you'd like to send one?
Is there anything wrong with changing it to private
? Otherwise when leaving it protected
, replacing the field in a inheriting Alarm
class again would be to easy, wouldn't it?
https://github.com/emilybache/Racing-Car-Katas/blob/1d66edf9c94f51eb4d169d3ad192a63dd88a8251/Java/TirePressureMonitoringSystem/src/main/java/tddmicroexercises/tirepressuremonitoringsystem/Alarm.java#L8
Is it intentional that the fields are not private? This makes "get it under test without changing the production code" relatively easy (which it wouldn't be otherwise)