Six Lines to Say “Hue”: The Cost of Enterprise Java Style

Java beans have a readability problem. Not the pattern itself — fields plus getters and setters is fine, and a great deal of the ecosystem still relies on it — but the house style the average enterprise codebase wraps around it. Six lines of boilerplate Javadoc and braces for a one-word concept, repeated for every property, until a class with eight fields scrolls for two pages and tells you nothing you didn’t already know from the field name.

Continue reading →

Using JsonPath safely with Jackson’s JsonNode tree model

When working with JSON in Java, Jackson’s JsonNode tree model is a popular choice — especially in framework code that processes or transforms data. But what if you want to query that tree using flexible JsonPath expressions?

Jayway JsonPath is a powerful tool, but using it with pre-parsed Jackson trees isn’t as obvious as you’d think — especially when you’re aiming for safe, predictable behavior in production.

In this post, I’ll share a few techniques I found helpful for reliably applying JsonPath to JsonNode trees, making your queries safer, clearer, and better suited to framework-level code.

Continue reading →

Long Names are Long

I found a hugely insightful article on naming. It encourages concise naming, and lays out really clear principles on how to name variables well.

“A name has two goals:

  • It needs to be clear: you need to know what the name refers to.
  • It needs to be precise: you need to know what it does not refer to.

After a name has accomplished those goals, any additional characters are dead weight.”

https://journal.stuffwithstuff.com/2016/06/16/long-names-are-long/

Avoiding insurmountable queue backlogs

Queues offer a promise of reliability for integrating applications, but can cause more subtle operational risks.

Queues exhibit ‘bi-modal behavior’ — low latency when everything is working well, but can rapidly form large backlogs when a failure occurs. This can dramatically increase the recovery time from outages.

Amazon offer an extremely interesting article about the reliability of queuing, with strategies to limit and manage backlogging.