From: Stefan B. <bo...@ap...> - 2015-02-16 11:52:21
|
On 2015-02-16, Harald Brabenetz wrote: > I would like to make the CompareMatcher extendable. This means that > the constructor and two methods must be protected instead private. The two protected methods would be the checkFor methods? You need those so you can have your own factory methods, AFAIU. If this was the only usecase they could be final. > This example is basically what I do with the Matcher on my current > Project: I write the test-Input into the FileSystem, where I can > manual review it. And when the changes are OK I can simply overwrite > my control-File with the written Test-File. You are cheating ;-) > On the other hand it is more difficult to maintain a Class which can > be extended. A protected constructor will signal "this class is extension friendly" so we better review its API and implementation to see whether this really is the case. Other than that, I don't see any issue. Stefan |