@yegor256 Imo it all depends on how we want to design our objects:
Do we want the Library to depend on the Books, or do we want the Book objects to depend on a Library object?
@odrotbohm@gunnarmorling@mikemybytes This is getting closer to property-based testing where the test parameters also become dynamic.
For eg, these few lines will fire 1000 tests with various combinations:
Did you know you can start a Docker container with a database for SpringBoot tests and connect to it via JDBC with just a **one-liner** ?
https://t.co/Y5VHhE7BQT
@maciejwalkowiak In my experience, if you rarely use mocks, and use them correctly… they can highlight boundaries and make those few tests more expressive.
But yes, with great power comes great responsibility:)
@david_whitney The main "problem" I see with constructors (and the "new" keyword) is that they aren't polymorphic. They will lock you into a specific type, whereas a static factory method won't.
My thoughts on @KentBeck's "Tidy First?".
PS: It's the first doing a book review, I've tried not to spoil it too much, check it out:
https://t.co/LozbhIrnv7
Hey folks! Ever struggled with messy code cluttered by side effects and tests full of mocks? Functional interfaces can help us tidy things up. Check out the before and after:
Full story on medium: https://t.co/uREfojQT4T
Let’s question one of the most commonly used coding patterns: getters and setters :)
inspired by #ElegantObjects.
#Java#CleanCode#OOP
https://t.co/lMfdyTPmf7