Bedrock Pattern : A better way of sharing code ?

You want to create a new java microservice `hello-world-api,` you have done this 20 time before , so you go and copy the last `hello-neighbour` project you did and start modifying it. You dont like this approach, you have always thought about writing a maven archetype project but never got to it, writing code generators are never fun or easy. Read on then….

Sajid Moinuddin
5 min readMay 12, 2019

--

Lets examine the components of a typical hello-world-spring boot app to get it production ready:

The Context:

Removing boilerplate code from project has always been a challenge in large scale software teams. With the popularity of microservices, this has become a even more critical as in microservices a major portion of the code is typically structural code. When you have 100s of microservices, you want to put some `Standardisation` across them. You want everyone follow the same logging pattern, same REST error standards, same docker base image etc..

Traditionally we solved it via Shared library / Generated Code / Monolith Project with feature flags:

--

--