<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Mikael Francoeur on foojay.io - Friends of OpenJDK</title><link>https://foojayio.github.io/website/today/author/mikael-francoeur/</link><description>Articles written by Mikael Francoeur on foojay.io - Friends of OpenJDK</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 12 Feb 2025 15:57:11 +0000</lastBuildDate><atom:link href="https://foojayio.github.io/website/today/author/mikael-francoeur/index.xml" rel="self" type="application/rss+xml"/><item><title>Building a declarative API with Spring AOP and SpEL</title><link>https://foojayio.github.io/website/today/building-a-declarative-api-with-spring-aop-and-spel/</link><pubDate>Wed, 12 Feb 2025 15:57:11 +0000</pubDate><guid>https://foojayio.github.io/website/today/building-a-declarative-api-with-spring-aop-and-spel/</guid><description>&lt;p&gt;&lt;strong&gt;In this article, we&amp;rsquo;ll implement a declarative API to perform tasks belonging to cross-cutting concerns, using auditing as an example. We&amp;rsquo;ll see how SpEL and Spring AOP allow us to easily intercept invocations throughout a code base and perform arbitrary logic in an expressive and non-invasive manner.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id="h2-0-a-story-about-legacy"&gt;A story about legacy&lt;/h2&gt;
&lt;p&gt;Let&amp;rsquo;s pretend that we inherited a legacy system. The system is in a dismal state, with every change always at risk of bringing the whole thing down. One day, there is a business requirement to audit a few dozen methods scattered throughout the code base. After every invocation of these methods, we should notify an external system by sending a client id and an operation (&lt;code&gt;1234&lt;/code&gt;, &lt;code&gt;&amp;quot;CREATE_USER&amp;quot;&lt;/code&gt;).&lt;/p&gt;</description></item><item><title>Who instruments the instrumenters?</title><link>https://foojayio.github.io/website/today/who-instruments-the-instrumenters/</link><pubDate>Thu, 30 May 2024 16:25:45 +0000</pubDate><guid>https://foojayio.github.io/website/today/who-instruments-the-instrumenters/</guid><description>&lt;p&gt;Have you ever wondered how libraries like &lt;a href="https://spring.io/" target="_blank" rel="noopener noreferrer"&gt;Spring&lt;/a&gt;
 and &lt;a href="https://site.mockito.org/" target="_blank" rel="noopener noreferrer"&gt;Mockito&lt;/a&gt;
 modify your code at run-time to implement all their advanced features?&lt;/p&gt;
&lt;p&gt;Wouldn&amp;rsquo;t it be cool to get a peek behind the curtains?&lt;/p&gt;
&lt;p&gt;This is the premise of my &lt;a href="https://github.com/parttimenerd/meta-agent" target="_blank" rel="noopener noreferrer"&gt;meta-agent&lt;/a&gt;
, a Java agent to instrument instrumenters, to get these insights and what this blog post is about.&lt;/p&gt;
&lt;p&gt;This article is a collaboration with &lt;a href="https://www.linkedin.com/in/mika%C3%ABl-francoeur/" target="_blank" rel="noopener noreferrer"&gt;Mikaël Francoeur&lt;/a&gt;
, who had the idea for the meta-agent and wrote most of this post. So it&amp;rsquo;s my first ever post-collaboration. But I start with a short introduction to the agent itself before Mikaël takes over with real-world examples.&lt;/p&gt;</description></item></channel></rss>