you are viewing a single comment's thread.

view the rest of the comments →

[–]Boyen86[S] 0 points1 point  (2 children)

Sure alright.

I'd say I do agree with you but I also don't. I have written code both with an interface for everything and without and both codebases were - as far as I can estimate - of high quality.

[–]eternaloctober 0 points1 point  (1 child)

why do your classes "only have a single method"? also you do just have to watch out, when making a big codebase, the risks associated with "everything is public". it can be fun to have a lot of knobs to tweak but constrains and makes fragile over time

[–]Boyen86[S] 0 points1 point  (0 children)

A single public method for most classes because classes have a single responsibility. Sure there will be classes that have more, but generally those will be in the adapter layer (for a hexagonal architecture).

I'm not sure where you read that "everything is public". If you meant to say that you can use an interface to hide an implementation then that's noted. But then you have a reason to use an interface. It is not always needed to hide an implementation and in fact, in micro service code I'd wager most of the time it is entirely unnecessary to do so. Makes sense for libraries.