adam bien's blog

Util Packages Are Evil 📎

util, common, base, infrastructure, model, framework names sounds great but are too generic as package names. Such names are un-cohesive by nature. Because of the abstract naming, they end up being a "kitchen sink". All inconvenient classes are placed in the "util" packages what makes such packages bloated, the classes harder to find and the application harder to maintain.

Instead of naming a package util, name it after it true responsibilities e.g. logging, monitoring etc. It will keep the packages small and the application easier to maintain.

[See also an in-depth discussion in the "Real World Java EE Patterns--Rethinking Best Practices" book (Second Iteration, "Green Book"), page 420 in, chapter "Pragmatic Java EE Architectures"]

See you at Java EE Workshops at MUC Airport (already sufficient registrations, so the workshop will absolutely take place)!