r/java • • Aug 11 '15

Top 10 Useful, Yet Paranoid Java Programming Techniques

http://blog.jooq.org/2015/08/11/top-10-useful-yet-paranoid-java-programming-techniques/
181 Upvotes

76 comments sorted by

View all comments

Show parent comments

7

u/lukaseder Aug 12 '15

You don't mock classes. You mock interfaces. Design for this approach!

3

u/voronaam Aug 12 '15

How is it there, in 2002? Just before PowerMock was created, I mean.

If you ever going to have one implementation of the interface - you do not need an interface. That is design, not throwing an interface as a facade for every bean!

1

u/lukaseder Aug 12 '15

This is going to be a fun discussion - yet - I'm seeing myself out. Cheers ;)

2

u/voronaam Aug 12 '15

It could've been - I do not usually throw such bold statements around. Next time, then.

P.S. I enjoyed Scala references, Scalatra is my framework of choice more often than not. And it is not interface(trait)-heavy ;)