Semprini

Entries for date "2020"

Python decorators and testing interplay

A trick for new players, when using decorators to register functions - E.g. a plug-in system.

Since unit testing automatically imports modules when looking for tests, you must remember to import modules using the decorator. If you don't your tests can pass but execution fails.

Also linters don't like importing without directly using as the act of importing the module registers the function but they are still technically 'unused'

Enterprise Microservices

If you have a "microservice" which exposes an API calling a back end system, you don't have a microservice - you have an API. Your API has wisely used some of the concepts of microservice architecture. Microservice architecture is not an integration architecture, it's an application architecture and applications are responsible for business logic. This distinction is important because the beauty of microservice architecture is both technical and behavioural.

However, I'll extend an olive branch to the API people, no doubt aghast by my blasphemy, by calling them "integration microservices".

Integration microservices are fine I guess, but too often they are used, just as integration is often used, to sweep the legacy monster under the carpet so we don't have to see it - out of sight, out of mind. We implement integration microservices containerised, auto-scaling, auto-healing etc, IT management has an orgasm, we all add something to our CVs and the legacy monster waits.