Mittwoch, 17. Juli 2019

Micro frontends - extending the microservice idea to frontend development

I think this article "Micro Frontends" (by Cam Jackson on martinfowler.com) is a great resource to get familiar with the idea about Micro frontends as we want to build it in our next project.

It gives an overview about when/why Micro frontends are useful, explains how these integration approaches are working by an example:
  • Server-side templates composition
  • Build-time integration
  • Run-time integration via
    • iFrames
    • JavaScript
    • Web Components
It gives also an approach for cross application communication and many more.

Code ownership - Quality vs Flexibility

Martin Fowler describes three different models of code ownership:
  • Strong code ownership
    "Strong code ownership breaks a code base up into modules (classes, functions, files) and assigns each module to one developer. Developers are only allowed to make changes to modules they own ..."
  • Weak code ownership
    "Weak code ownership is similar in that modules are assigned to owners, but different in that developers are allowed to change modules owned by other people. Module owners are expected to take responsibility for the modules they own and keep an eye on changes made by other people ..."
  • Collective code ownership
    "Collective code ownership abandons any notion of individual ownership of modules. The code base is owned by the entire team and anyone may make changes anywhere ..."
I'm agree with him when he says "Personally I prefer the dynamics of a collective code ownership team" - but only if you have a "team" in mind like a Scrum team of 4-6 Developers (+ ScM & PO) and not a whole department (> 30 developers) - as some people may believe. In general, these three code ownership models are a trade-off between quality and flexibility. I think the trade-off is manageable within a small team but gets out of control when the number of people changing code increases.

Freitag, 5. Juli 2019

Flaky tests (non-deterministic tests) are useless

"Non-deterministic tests have two problems, firstly they are useless, secondly they are a virulent infection that can completely ruin your entire test suite. https://martinfowler.com/articles/nonDeterminism.html" Source Twitter

I think that statement summarizes the problem very well and the linked article by Martin Fowler explains that statement very well - so I would recommend to everyone to read the article. Although it was written in 2011 the listed kind of problems are still the same.

Remote Mob Programming und Mob Programming

Über diesen Erfahrungsbericht (Remote Mob Programming - Home but not alone) im Rahmen eines Podcasts bin ich auf das Thema Remote Mob Programming gestoßen.
Die Podcast-Folge selbst ist empfehlenswert, dort verlinkt sind aber auch diese Ressourcen zum Nachlesen:
Zum Thema "Mob Programming" ansich (also ohne Remote) fasst sich in diesem Satz von Woody Zuill zusammen:
"All the brilliant people working on the same thing, at the same time, in the same space, and on the same computer"
Das wichtige an dem Verfahren ist die Kommunikation und der Erfahrungsaustausch, sowie das gemeinsame Treffen von Entscheidungen - sowie das wissen, warum diese Entscheidungen getroffen wurde. So sind auch diese Aussagen zu verstehen (siehe Three constraints for introducing Mob Programming):
  • It’s a behaviour change from “I have an idea, give me the keyboard” to “I have an idea, you take the keyboard
  • For an idea to go from your brain to the computer, you have to use someone else’s hands - [Llewellyn Falco]
Am sinnvollsten scheint mir das Verfahren als Start für ein neues/verändertes Team als Teambuildingevent und beim Start von neuen Projekten.
Ein weiterer (mir) wichtiger Punkt ist, dass man auch gemeinsam Dokumentation schreibt - ich kann mir vorstellen, dass dadurch bessere und relevantere Dokumentation entstehen kann.

Dienstag, 11. Juni 2019

Architecture decision record (ADR)

In a side note of a podcast I found the topic "Architecture decision record (ADR)".
The blog-post of thinkrelevance "Documenting Architecture Decisions" gives a very good motivation about why you should care about this topic and what ADRs are.

I'm on the same page that it makes sense to write ADRs into the repository for open source projects. Maybe it is also true for an enterprise company. But I think it maybe easier to start with wiki/confluence articles in that environment - especially one pro is that you can use images and not only text.

Further I found this github-repro, which provides an overview and some templates. But for me it looks like that it is a good advice to start with the simplest version of Michael Nygard, because for me is the argument that it should be a "short text file" important, because it shouldn't take much time to get the point of the decision and why it was made.

Sonntag, 9. Juni 2019

DevDocs.io central API Documentation

I found a helpful resource that offers the API of different languages, libraries and frameworks in a standardized form and in one (web-) tool:
https://devdocs.io

Because you can load a selection of APIs into the browser's offline cache, the tool has a very fast response time - even if the web page is not available (e.g. if you are sitting in a lane with a poor Internet connection). If you want to search something in CSS for instance, just enter CSS, press tab and enter the search phrase.

It is really worth to take a look at it. Also take a look into the preferences - it allows to enable a dark theme ;)

Donnerstag, 14. März 2019

If there is no Link, it does not exist

Auf der JAX 2018 haben wir dem Talk "DevOps @ GitHub Speed" gelauscht. Der Vortrag ist in der Zwischenzeit nun auch bei YouTube "DevOps @ GitHub Speed" zu finden und man kann da als Entwickler, Scrum Master, PO oder auch jede andere Rolle eines Softwareunternehmens eine Menge lernen.
Einen Aspekt möchte ich besonders empfehlen, den ich auch versuche bei meiner Arbeit anzuwenden und zu verbreiten ist:

If there is no Link, it does not exist

Die Argumentation und was damit genau gemeint ist kann man sich in dem Video ab Minute 24:00 anschauen. Im groben Zusammengefasst ist damit gemeint:

Entscheidungen sind irrelevant, wenn sie nicht per Link für alle auffindbar sind

Beispiel: Entscheidungen, die ausschließlich per E-Mail dokumentiert sind, sind nur in den E-Mail-Postfächern der Mitarbeiter auffindbar, die an dem Mail-Verkehr beteiligt waren. Neue Mitarbeiter können diese nicht einsehen.
Gleiches gilt meines Erachtens auch für die Entscheidungsfindung - also wie es zu der Entscheidung gekommen ist. Wie oft habe ich schon erlebt, dass wir eine dokumentierte Entscheidung gefunden haben, diese gerne hinterfragen wollten, wir aber nicht wussten, warum diese Entscheidung so getroffen wurde und auch die beteiligten Personen dies nicht mehr wussten.

Start another main class within a Spring Boot jar

When you build your Spring Boot application with Maven and package it as a jar file you will start it via java -jar yourApp.jar. This will start the application with the class which is annotated with @SpringBootApplication. But what if there is another main-class you sometimes want to start?


When you normally work with Java you would do something like this:
java -classpath "yourApp.jar" your.domain.AnotherMainClass
But this will not work and you get this output instead:
Error: Could not find or load main class your.domain.AnotherMainClass

So there is something different than in normal Java jars.


Having a look into the META-INF\MANIFEST.MF within the jar shows that org.springframework.boot.loader.JarLauncher is defined there as Main-Class. After searching a while for that problem and with the information of the JarLauncher I was able to find this page https://docs.spring.io/spring-boot/docs/current/reference/html/executable-jar.html which defines a PropertiesLauncher that is able to launch another main class when defining it with the property loader.main.

So finally this worked for me:
java -classpath "yourApp.jar" -Dloader.main=your.domain.AnotherMainClass org.springframework.boot.loader.PropertiesLauncher