Recently I was working on a project where we were working with a third party in order to process different Office files. This third-party had both a production tenant as well as a development tenant as can be common with these types of integrations. The development tenant was much less…


Photo by amirali mirhashemian on Unsplash

Eventually, it seems that every developer will be presented with a problem that requires some kind of work queue. These work queues can be used to store a collection of tasks to be worked in some order and move on. Although the concept of these work queues may be simple…


Photo by Iwona Castiello d'Antonio on Unsplash

Whereas the last item discussed in Effective Java covered the cases where we need to use synchronization, this chapter covers the concern with excessive synchronization. Whereas the lack of synchronization can lead to liveness issues and safety issues, excessive synchronization can lead to reduced performance, deadlock, and nondeterminism.

An important…


Photo by Vincent Branciforti on Unsplash

This item starts a new section of Effective Java that focuses on concurrency and tips and tricks around that topic. This first topic focuses on the use of synchronization. When Java developers think about synchronization they likely think of the synchronized keyword. This is for good reason, this keyword is…


Photo by Ian Barsby on Unsplash

Something that likely feels obvious but can be tempting is ignoring exceptions. This is often a major red flag. It is extremely easy to ignore exceptions, you simply surround your exception throwing code with a try and empty catch block.

Exceptions are thrown when exceptional circumstances are experienced so by…


Photo by Dan Meyers on Unsplash

Even after an object throws an exception it is expected and desirable that the object is still in a valid state. Unless the exception that is thrown is a fatal exception the application will keep moving forward and thus leaving the object in an invalid state is just asking for…


Photo by Scott Van Hoy on Unsplash

Often when we are analyzing a failure of some code all we are left with is the logs that are left behind. Seeing as this is the case, we want to give ourselves the best chance of success. When a program fails the system will automatically output the exception’s stack…


Photo by Sigmund on Unsplash

Documentation is critical for quickly understanding a class and its methods. Exceptions, both checked and unchecked, are part of the contract of a method and thus should be properly documented to allow users of your code to quickly understand how your code behaves.

Part of what makes good documentation is…


Photo by Wade Lambert on Unsplash

Much of Effective Java focuses on building a clean, understandable API and how that is the foundation of a great library. Part of the API of a class is any exceptions it may throw up the stack both checked (where it becomes part of the signature) or unchecked. As writers…


Photo by Maksym Kaharlytskyi on Unsplash

Every once in a while as a developer you find yourself stepping, and falling, into a much deeper rabbit hole than you would expect. I recently had one of these experiences as I have dug into the world of unique identifiers. It is this rabbit hole that I would like…

Kyle Carter

I'm a software architect that has a passion for software design and sharing with those around me

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store