<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Matthew Murray</title>
    <description>The latest articles on DEV Community by Matthew Murray (@mattmurr).</description>
    <link>https://dev.to/mattmurr</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1152570%2F50e9e56a-4ac1-4270-bcad-5de18821e43b.png</url>
      <title>DEV Community: Matthew Murray</title>
      <link>https://dev.to/mattmurr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mattmurr"/>
    <language>en</language>
    <item>
      <title>Sleeping on the floor</title>
      <dc:creator>Matthew Murray</dc:creator>
      <pubDate>Sat, 22 Aug 2026 10:05:34 +0000</pubDate>
      <link>https://dev.to/mattmurr/sleeping-on-the-floor-131e</link>
      <guid>https://dev.to/mattmurr/sleeping-on-the-floor-131e</guid>
      <description>&lt;p&gt;Something&lt;/p&gt;

</description>
    </item>
    <item>
      <title>@StandardException</title>
      <dc:creator>Matthew Murray</dc:creator>
      <pubDate>Sat, 22 Aug 2026 10:05:33 +0000</pubDate>
      <link>https://dev.to/mattmurr/standardexception-4edl</link>
      <guid>https://dev.to/mattmurr/standardexception-4edl</guid>
      <description>&lt;p&gt;I recently came across a little gem annotation from &lt;a href="https://projectlombok.org" rel="noopener noreferrer"&gt;Lombok&lt;/a&gt; that I had never heard of before: &lt;code&gt;@StandardException&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You can annotate your Exception classes (&lt;code&gt;extends exception&lt;/code&gt;) with this annotation, it will generate the usual constructors for your exception type that you would normally write.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://projectlombok.org/features/experimental/StandardException" rel="noopener noreferrer"&gt;https://projectlombok.org/features/experimental/StandardException&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a small thing, but it can save you some time and make your code cleaner. I will definitely be using this annotation in my future projects.&lt;/p&gt;

&lt;p&gt;On one hand, this makes me wonder about all the other useful annotations that I have not yet discovered, but it also led me to think about &lt;a href="https://theboreddev.com/the-problems-of-annotation-driven-development/" rel="noopener noreferrer"&gt;the problems of annotation driven development&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>software</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>@Delegate annotation</title>
      <dc:creator>Matthew Murray</dc:creator>
      <pubDate>Sat, 22 Aug 2026 10:05:02 +0000</pubDate>
      <link>https://dev.to/mattmurr/delegate-annotation-41d8</link>
      <guid>https://dev.to/mattmurr/delegate-annotation-41d8</guid>
      <description>&lt;p&gt;I recently came across the &lt;code&gt;@Delegate&lt;/code&gt; annotation from &lt;a href="https://projectlombok.org" rel="noopener noreferrer"&gt;Lombok&lt;/a&gt;.&lt;br&gt;
It turns out I'm not the only person who frequently discovers new things about Lombok, as I've written about another annotation recently: &lt;a href="//../lombok-standard-exception/"&gt;&lt;code&gt;@StandardException&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;@Delegate&lt;/code&gt; annotation is a handy way to delegate methods from one class to another. This can be useful when you want to reuse the methods of another class without having to write them all out again.&lt;/p&gt;

&lt;p&gt;Here's a simple example to demonstrate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;lombok.experimental.Delegate&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DelegateExample&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;Greet&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;GreetImpl&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;Greet&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nd"&gt;@Override&lt;/span&gt;
        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"Hello, World!"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="nd"&gt;@Delegate&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;Greet&lt;/span&gt; &lt;span class="n"&gt;greet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;GreetImpl&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;DelegateExample&lt;/span&gt; &lt;span class="n"&gt;example&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DelegateExample&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;greet&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we have an interface &lt;code&gt;Greet&lt;/code&gt; with a single method &lt;code&gt;greet()&lt;/code&gt;. We then have a class &lt;code&gt;GreetImpl&lt;/code&gt; that implements this interface. Finally, we have a &lt;code&gt;DelegateExample&lt;/code&gt; class that uses the &lt;code&gt;@Delegate&lt;/code&gt; annotation to delegate the &lt;code&gt;greet()&lt;/code&gt; method to an instance of &lt;code&gt;GreetImpl&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This code will output &lt;code&gt;Hello, World!&lt;/code&gt;, which is the result of calling the &lt;code&gt;greet()&lt;/code&gt; method on the &lt;code&gt;GreetImpl&lt;/code&gt; instance.&lt;/p&gt;

&lt;p&gt;According to the &lt;a href="https://projectlombok.org/features/experimental/Delegate" rel="noopener noreferrer"&gt;Lombok page on &lt;code&gt;@Delegate&lt;/code&gt;&lt;/a&gt;, this annotation will probably not move out of experimental status, so use it with caution. However, it can be a useful tool in your toolbox when you need to delegate methods between classes.&lt;/p&gt;

&lt;p&gt;I'm always a fan of reducing boilerplate code especially when it comes to Java, &lt;code&gt;@Delegate&lt;/code&gt; is a great way to do that when you need to reuse methods across classes. I'll definitely be keeping this annotation in mind for future projects.&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>JManc Unconference 24</title>
      <dc:creator>Matthew Murray</dc:creator>
      <pubDate>Sat, 22 Aug 2026 10:05:00 +0000</pubDate>
      <link>https://dev.to/mattmurr/jmanc-unconference-24-ff0</link>
      <guid>https://dev.to/mattmurr/jmanc-unconference-24-ff0</guid>
      <description>&lt;p&gt;I recently attended the JManc Unconference 24, and it was a great experience. The event was held at the Auto Trader's office in Manchester, and it was a full day of discussing all things Java.&lt;/p&gt;

&lt;p&gt;The day kicked off with a keynote from Helen Scott, a developer advocate at JetBrains, the keynote was focused on AI, touching on developer effectiveness. &lt;/p&gt;

&lt;p&gt;The event followed an &lt;a href="https://en.wikipedia.org/wiki/Open_space_technology" rel="noopener noreferrer"&gt;Open Space Technology&lt;/a&gt; format where the attendees could propose sessions and join in on the ones that interested them. The schedule ended up as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/.%2Fassets%2Fimg%2FIMG_0909.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/.%2Fassets%2Fimg%2FIMG_0909.jpeg" alt="The decided schedule" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It was interesting to hear other people's thoughts on each topic. I felt that some sessions lacked direction, but I think that's the nature of the format. The facilitators tried their best to navigate, avoiding &lt;em&gt;awkward conversations and silence.&lt;/em&gt; I enjoyed the sessions that were more focused and had a clear direction on the topic being discussed.&lt;/p&gt;

&lt;p&gt;There is one law of the Open Space Technology format: "The Law of Two Feet":&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If at any time during our time together you find yourself in any situation where you are neither learning nor contributing, use your two feet, go someplace else.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I will remember this for next time. I'm looking forward it, and I hope to see some familiar faces there.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Streamline password management on MacOS with pass &amp; fzf</title>
      <dc:creator>Matthew Murray</dc:creator>
      <pubDate>Sat, 22 Aug 2026 10:04:29 +0000</pubDate>
      <link>https://dev.to/mattmurr/streamline-password-management-on-macos-with-pass-fzf-1551</link>
      <guid>https://dev.to/mattmurr/streamline-password-management-on-macos-with-pass-fzf-1551</guid>
      <description>&lt;p&gt;I use &lt;a href="https://www.passwordstore.org/" rel="noopener noreferrer"&gt;&lt;code&gt;pass&lt;/code&gt;&lt;/a&gt; and this simple shell script that searches &lt;code&gt;.gpg&lt;/code&gt; files in &lt;code&gt;~/.password-store&lt;/code&gt; or &lt;code&gt;PASSWORD_STORE_DIR&lt;/code&gt; (if set) and pipes into &lt;a href="https://https//github.com/junegunn/fzf" rel="noopener noreferrer"&gt;&lt;code&gt;fzf&lt;/code&gt;&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;

&lt;span class="nb"&gt;pushd&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;PASSWORD_STORE_DIR&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="p"&gt;/.password-store&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nv"&gt;PASSFILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;fd &lt;span class="nt"&gt;-t&lt;/span&gt; file &lt;span class="nt"&gt;-e&lt;/span&gt; gpg &lt;span class="nt"&gt;--color&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;always | &lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="s1"&gt;'s/\.gpg//; s/^\.\///'&lt;/span&gt; | fzf &lt;span class="nt"&gt;--ansi&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nb"&gt;popd&lt;/span&gt;

&lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-z&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$PASSFILE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;exit &lt;/span&gt;0

pass &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="nv"&gt;$PASSFILE&lt;/span&gt; 1&amp;gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://github.com/deseven/iCanHazShortcut" rel="noopener noreferrer"&gt;iCanHazShortcut&lt;/a&gt; let me assign shortcuts to my script. Pressing &lt;strong&gt;Command&lt;/strong&gt; + &lt;strong&gt;P&lt;/strong&gt; runs &lt;code&gt;alacritty -e sh -c '~/bin/fzf-passmenu'&lt;/code&gt;, which opens a new terminal window and runs the script. It's a fast and simple process.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>From sitting, to standing, and now I'm on the floor</title>
      <dc:creator>Matthew Murray</dc:creator>
      <pubDate>Sat, 22 Aug 2026 10:04:27 +0000</pubDate>
      <link>https://dev.to/mattmurr/from-sitting-to-standing-and-now-im-on-the-floor-1o6m</link>
      <guid>https://dev.to/mattmurr/from-sitting-to-standing-and-now-im-on-the-floor-1o6m</guid>
      <description>&lt;p&gt;I've opted for taking apart my &lt;a href="https://flexispot.co.uk/adjustable-standing-desk-pro-series.html" rel="noopener noreferrer"&gt;FlexiSpot standing desk&lt;/a&gt; down in favour of a portable &lt;a href="https://en.wikipedia.org/wiki/Chabudai" rel="noopener noreferrer"&gt;Chabudai&lt;/a&gt; style of table and a "meditation" cushion to sit on. These tables are really low down close to the ground and suited for working whilst sitting on the floor.&lt;/p&gt;

&lt;p&gt;Long gone are the days of being constrained to a desk in my bedroom, but instead a small table I can set out anywhere in the house. I want to enjoy all parts of my home while WFH, and encourage myself to go out to work, whether this be at the office or a coffee shop. Essentially moving around a lot more!&lt;/p&gt;

&lt;p&gt;Supposedly there are long term benefits to sitting naturally, on the floor. I'm sure it will take some getting used to.&lt;/p&gt;

&lt;p&gt;These are the items for anyone interested:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.amazon.co.uk/gp/product/B0BF11XPQZ/ref=ppx_yo_dt_b_asin_title_o02_s02?ie=UTF8&amp;amp;th=1" rel="noopener noreferrer"&gt;Meditation cushion&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.amazon.co.uk/gp/product/B0C1N1Q8CH/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&amp;amp;psc=1" rel="noopener noreferrer"&gt;Portable floor desk&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Looking into Spring Validation</title>
      <dc:creator>Matthew Murray</dc:creator>
      <pubDate>Sat, 22 Aug 2026 09:57:31 +0000</pubDate>
      <link>https://dev.to/mattmurr/looking-into-spring-validation-2gig</link>
      <guid>https://dev.to/mattmurr/looking-into-spring-validation-2gig</guid>
      <description>&lt;p&gt;I recently had a look into Spring Validation and discovered new ways it can be used. Here's a simple example that is commonly used in Spring Boot applications.&lt;/p&gt;

&lt;p&gt;A simple &lt;code&gt;Person&lt;/code&gt; class with validation constraint annotations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.example.spring_validated.lib&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;jakarta.validation.constraints.Min&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;jakarta.validation.constraints.NotBlank&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Person&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@NotBlank&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Min&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;Person&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And a controller that uses the &lt;code&gt;Person&lt;/code&gt; class as a dependency:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.example.spring_validated&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.example.spring_validated.lib.Person&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;jakarta.validation.Valid&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.springframework.validation.annotation.Validated&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.springframework.web.bind.annotation.PostMapping&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.springframework.web.bind.annotation.RequestBody&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.springframework.web.bind.annotation.RestController&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@RestController&lt;/span&gt;
&lt;span class="nd"&gt;@Validated&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;PersonController&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@PostMapping&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/person"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="nf"&gt;createPerson&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@Valid&lt;/span&gt; &lt;span class="nd"&gt;@RequestBody&lt;/span&gt; &lt;span class="nc"&gt;Person&lt;/span&gt; &lt;span class="n"&gt;person&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s"&gt;"Person created: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;person&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getName&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we use this endpoint without giving a name in the request body, we will get a &lt;strong&gt;400 Bad Request&lt;/strong&gt; response since it does not meet the constraints in the &lt;code&gt;Person&lt;/code&gt; class.&lt;/p&gt;

&lt;p&gt;In my application, the &lt;code&gt;Person&lt;/code&gt; class is declared in a separate library, meaning that Spring Validation actually works across different libraries. Additionally, not only will Spring Validation apply constraints from your dependency class, but it also works with sub-dependencies as long as they are annotated with &lt;code&gt;@Valid&lt;/code&gt;, like this &lt;code&gt;Address&lt;/code&gt; record:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.example.spring_validated.anotherlib&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;jakarta.validation.constraints.NotBlank&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="n"&gt;record&lt;/span&gt; &lt;span class="nf"&gt;Address&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@NotBlank&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;street&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.example.spring_validated.lib&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.example.spring_validated.anotherlib.Address&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;jakarta.validation.constraints.Min&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;jakarta.validation.constraints.NotBlank&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Person&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@NotBlank&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Min&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@NotNull&lt;/span&gt;
    &lt;span class="nd"&gt;@Valid&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Address&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;Person&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My investigation was led by a desire to validate outside a controller, and I found that &lt;code&gt;@Validated&lt;/code&gt; can also be applied to other beans like Services.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.example.spring_validated.app&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.springframework.stereotype.Service&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.springframework.validation.annotation.Validated&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.example.spring_validated.lib.Person&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;jakarta.validation.Valid&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@Service&lt;/span&gt;
&lt;span class="nd"&gt;@Validated&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;PersonService&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

  &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nd"&gt;@Valid&lt;/span&gt; &lt;span class="nc"&gt;Person&lt;/span&gt; &lt;span class="n"&gt;person&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Validated person: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;person&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful in my case where I want to validate data classes that we formed via extensive business logic before it is persisted or sent to another service.&lt;/p&gt;

&lt;p&gt;I found some new ways to apply validations in my applications and I hope you can too.&lt;/p&gt;

</description>
      <category>backend</category>
      <category>java</category>
      <category>springboot</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>New beginnings</title>
      <dc:creator>Matthew Murray</dc:creator>
      <pubDate>Sat, 22 Aug 2026 09:57:30 +0000</pubDate>
      <link>https://dev.to/mattmurr/new-beginnings-26f0</link>
      <guid>https://dev.to/mattmurr/new-beginnings-26f0</guid>
      <description>&lt;p&gt;After a long struggle with my old blog, I've decided to start fresh. I'm going to write about all the things that interest me, and I hope you'll enjoy reading about them.&lt;/p&gt;

&lt;p&gt;I'm planning to write about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Software development&lt;/li&gt;
&lt;li&gt;Technology&lt;/li&gt;
&lt;li&gt;Books&lt;/li&gt;
&lt;li&gt;My vegetable garden&lt;/li&gt;
&lt;li&gt;And anything else that catches my interest&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This blog will also act as a sort of public notebook for myself. I'm always learning new things, and I want to keep track of what I've learned. I hope that by writing about it, I'll be able to retain more information.&lt;/p&gt;

&lt;p&gt;It will be interesting to see if I can keep up with this blog given my hectic family life, but I'm determined to give it a shot.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
