This post is about how to inject and persist architectural vision in a code base, based on a recent experience.
High-level approach to restructure and refactor of a messy code base
Persist architectural vision to outlive people and team changes and move the code in a single direction.
Preface: The tale of my own legacy
Some code comes wi...
One problem I often encounter, are errors without any context.
If an arbitrary method returns an error "invalid character '}' after object key", you will have to dive down the stack until you find
the exact place the error happened. Therefore whenever you receive an error and you decide to not handle it, but instead
return it to the caller of y...
Recently I came across the problem of ThreadLocal context in multithreaded environment.
If the Thread that handled a request uses an Executor
to asynchronously execute tasks, the ThreadLocal context is lost and information such as requestId will be be missing in the logs.
We can solve this using the Decorator pattern:
Wrap Runnable to pre...
Disclaimer 2020: Distributed tracing is provided by various libraries (like Sleuth). Please consider existing, battle-proof libraries before implementing something yourself.
In a microservice architecture, one request can lead to multiple log entries
distributed across services.
One client request can cause multiple internal requests, which ag...
Simplejson is an imitation of Java’s json-simple for go language. It allows to access json-data without the overhead of
predefining a model or casting elements manually. Therefore it is useful, whenever you want to get data from different schemas
in a quick and clean way. It additionally provides a handy Error-handling, as well as segmented keys...
There are tons of approaches how to update UI when data changes or other way round, short Model binding. In this
post we will investigate four possible implementations of a one-way binding and compare their performance in a series
of tests. Different code snippets provide an overview of the complexity when applying the approaches to a real exam...