Tagged with "design"

The Cost Of Consistency: When 9ms Is 1s Too Much

The CAP theorem remains one of the most important tools in my software developer's toolbelt. Used correctly, it can help create services and products that can offer an excellent user experience and protect revenue during partial failures. Used incorrectly, it can lead to a poor user experience and loss of ... read more

The Concurrency Of ConcurrentHashMap

Java's ConcurrentHashMap is an excellent point of study when learning about Java's Memory Model. It employs numerous techniques to provide lock-free reads while still guaranteeing safe publication of objects. This article represents my attempt to take the magic out of the ConcurrentHashMap implementation. ... read more

Impact Of Local Variable Declaration Location

Does the location of a local variable's declaration result in performance changes of a method? For example, will a String variable, s, declared outside of a loop exhibit "better" performance than when declared inside a loop? In Java, looking at a class' bytecode explains, irrefutably, why the answer is ... read more

Safe Publication Of Transient Members

A very common (and quite dangerous) tripping point I find in concurrent Java code is that of unsafe member publication of otherwise safely-published objects. Of course, concurrent code is difficult to get right and I occasionally find myself identifying the same mistake in my own code---but usually only after a ... read more

A Case Of Leaky State

Leaky state is among the most common artifacts I find in existing applications. It's a symptom of poor encapsulation and/or abstraction and typically tends to unmaintainable code. Such symptoms are typically, but by no means exclusively, seen in an anemic domain model. Controlling state by means of encapsulation and ... read more
1