I’m currently working on a software designed more than a decade ago. It offers a plugin architecture: you can develop a plugin whose lifecycle is handled by the software. The tough part, though, is how you access the platform capabilities: via static methods on singletons. @Override public boolean start() { var aService = AService.getInstance(); var anotherService = AnotherService.getInstance(); // Do something with the services var result = ...; return result; } T| A Java geek
In OOP, objects collaborate. The initial idea of collaboration, first found in Smalltalk, was for object A to send a message to object B. Languages designed later use method calling. In both cases, the same question stands: how does an object reference other objects to reach the desired results? In this post, I tackle the problem of passing dependencies to an object. I will go through several options and analyze their respective pros and cons. Constructor injection For constructor injection| A Java geek
Two years ago, my friend José Paumard held the talk 'Concurrent and Asynchronous Programming : Loom' at the Geneva Java User Group. In his talk, he mentioned that the Spring team would need to completely redesign their approach to transaction: his reasoning was that the transactions are implemented on top of ThreadLocal object and Loom’s virtual threads break this approach. I was intrigued because though I used Spring transactions a lot via the @Transactional annotation, I never opened thou| A Java geek
Last week, I described a gloomy situation: all public TLS certificate providers log your requests. By browsing through the subdomains, one can get their respective IP addresses. If one of them points to your home route, they know your general location. I analyzed several solutions and decided to use wildcard certificates, which don’t leak subdomain information, while continuing to use Let’s Encrypt. My solution caters to my Synology NAS, as it’s the one I’m using. Gett| A Java geek
I recently learned about a new way to leak your privacy, and it’s a scary one. Before going further, know that I’m not a network engineer: perhaps if you work in the field, you’ve known it for your whole career, but it’s quite new to me. Let me share my findings and you can judge. Because the original post was quite lengthy, I broke it down into two instalments, the problem and the solution. The problemThe solution| A Java geek
I recently learned about a new way to leak your privacy, and it’s a scary one. Before going further, know that I’m not a network engineer: perhaps if you work in this field, you’ve known it for your whole career, but it’s quite new to me. Let me share my findings, and you can judge for yourself. Since the original post was quite lengthy, I have broken it down into two installments: the problem and the solution. The situation I own my own domain. I’ve created mu| A Java geek
You learn by comparing to what you already know. I was recently bitten by assuming Rust worked as Java regarding transitive dependency version resolution. In this post, I want to compare the two. Dependencies, transitivity, and version resolution Before diving into the specifics of each stack, let’s describe the domain and the problems that come with it. When developing any project above Hello World level, chances are you’ll face problems that others have faced before. If the pr| A Java geek
Java has a vast ecosystem of APIs, not all of which are effective or easy to learn. Developing a good API is not trivial: misdesigning key elements, defining simple abstractions, and threading models are among the themes that must be addressed. The official Elasticsearch Java SDK is a project with a design effort that has been made to address these elements. Recently, this project surprised me, and I tried to examine the design ideas that make it interesting and effective, while also having som| A Java geek
Creational patterns were first described in the famous Gang of Four’s Design Patterns. The book presents each pattern in a dedicated chapter and follows a strict structure for each one: intent, motivation, applicability, structure, participants, collaborations, consequences, implementation, sample codes, known uses, and related patterns. The intent pattern presents a succinct goal of the pattern, while the applicability tells when you should use it. For example, here’s an excerpt fo| A Java geek
I’ve quite a lengthy experience with GitHub workflows, but not up to the point where I can claim I’m an expert. However, I recently developed a new workflow, and it prompted me to write this post. Feel free to add your own. What are GitHub workflows? A workflow is a configurable automated process that will run one or more jobs. Workflows are defined by a YAML file checked in to your repository and will run when triggered by an event in your repository, or they can be triggered m| A Java geek
When I first started attending conferences, I diligently tried to write down notes and publish them. It forced me to actively listen to the talks I was attending. With the number of conferences rising, I couldn’t keep the rhythm. When I switched my career path to Developer Advocate, I drastically diminished the number of talks I attended in favor of the hallway track. As a result, the last conference 'report' I wrote was JPrime’s in 2022. This week, I was privileged to speak at DevO| A Java geek
You may know I’m a big fan of OpenTelemetry. I recently finished developing a master class for the YOW! conference at the end of the year. During development, I noticed massive differences in configuration and results across programming languages. Even worse, differences exist across frameworks inside the same programming language. In this post, I want to compare the different zero-code OpenTelemetry approaches on the JVM, covering the most widespread: Spring Boot with Micrometer Tracing| A Java geek
This is the 6th post in the My journey with Home Assistant focus series. I continue to take care of my Home Assistant. This week, I replaced my original setup with Cloudflare Tunnel.| A Java geek
I’m continuing my series on running the test suite for each Pull Request on Kubernetes. In the previous post, I laid the groundwork for our learning journey: I developed a basic JVM-based CRUD app, tested it locally using Testcontainers, and tested it in a GitHub workflow with a GitHub service container. This week, I will raise the ante to run the end-to-end test in the target Kubernetes environment. For this, I’ve identified gaps that I’ll implement in this blog post: Create| A Java geek
This is the 3rd post in the My journey with Home Assistant focus series. I’m the happy owner of a couple of Philips Hue connected lights for a some years. Some of them are colored, some of them regular. In addition, I bought a sensor to go along with the light I installed in my toilets: it turns on automatically when its detects a movement there. In this post, I want to document how I replaced the proprietary automation with Home Assistant’s.| A Java geek
Home Assistant is a massive beast. It can be overwhelming for a newcomer; it was for me. In this post, I want to describe the underlying model of Home Assistant, which is a good entry point for your home automation journey. The biggest issue in describing the Home Assistant is the number of conflicting sources for this model: The helpers package of the GitHub repositoryThe database; disclaimer: I didn’t find the schema generation in the code, and I wasn’t bold enough to check the d| A Java geek
GitHub offers a way to customize one’s profile by allowing one to create a README in a specific repository, named as your profile, e.g., nfrankel/nfrankel. A couple of years ago, I automated the update of my GitHub profile with up-to-date info: my latest blog posts, my upcoming talks, and the last recorded YouTube talk. I took the time to document how to do it on this blog. At the time, I chose Kotlin scripting because I was proficient enough in Kotlin, but I wanted to learn the scripting| A Java geek