Java Anti-Patterns

Have you ever found yourself using certain library or approach, but instead of feeling empowered by it, you constantly have to fight back, go against the flow and bend the rules in order to achieve things? Congratulations, you’ve found your personal anti-pattern.

Some anti-patterns are generic in nature: they just don’t work with programmers in general. Some anti-patterns are very subjective: some people love rx and async while others hate it and proclaim it anti-pattern. Some things work for complexity-loving Germans while not for the simplicity-loving me. Just wanted to clarify this beforehand, before another holy war is started.

My personal list of anti-patterns in Java ecosystem:

The right way to develop apps in Java:

  • Avoid the abovementioned shit. Specifically, avoid both Spring and JavaEE. You can run your app just fine on Jetty or Tomcat.
  • Learn and use Docker. You can build and run a production image anywhere: both on your dev machine and on production.
  • Use SQL directly; use JDBI or other stuff that talks to SQL directly.
  • Use Component-Oriented programming
  • Use SOA: wrap your data with services then call them from your UI code.

My preferred Vaadin architecture

See My Favorite Vaadin Architecture.

Written on January 3, 2021