Friday 25 November 2022

Why do I write this blog?

I came across two Twitter feeds (is that the word?) that mirrored my thoughts on why I write this blog.

Camille Fournier I love how many blog posts I ave that are 80% complete and will probably have to be completely rewritten to actually be complete. Ugh. Writing.
Brian Goetz You've fallen for your own Jedi mind trick, which is that you are writing for others. Really, its about organizing, validating, and sharpening your thinking, and the pot of "likes" at the end of the rainbow is just motivation. In the end, it's mostly for you. So, success!

Thursday 17 November 2022

Java Beans

Back when I was young and innocent, and when I started learning about Beans. Java Beans, Java Bean Conventions, EJB Beans, and all that, I started writing Beans.

So I ended up with a lot of classes called ItemsBean, UsersBean, etc.

I visited this admittedly old code, and immediately thought, "What was I thinking?!?".

A Bean, though most veteran Java Programmers have an incling what it is, does not provide ANY meaning to people outside the Java field. Even for Java people, it doesn't explain a lot.

This is a naming scheme where a lot of people completely got it wrong.

Sure, Beans is cute and funny in combination with Java (coffee, in case I have to spell it out.)

So, paraphrasing Uncle Bob here:

“Don't be cute.”
- Uncle Bob (Robert C. Martin)

Unfortunately, we're kinda stuck with the naming scheme for now. I will just point everyone to the magical file "beans.xml" that is supposed to just exist in a certain place, to make magic happen.

Don't get me wrong. I love Java. But, admittedly, sometimes it's weird...

References

Clean Code - Chapter 2 - Meaningful Names (Robert C. Martin)
http://cleancoder.com/

Thursday 10 November 2022

J-Fall 2022 Writeup

I went to J-Fall 2022 on the 3d of November 2022.

I attended the following sessions:

Pattern Matching: Small Enhancement or Major Feature? - Hanno Embregts Peter Wessels
I enjoyed it immensely.
Design Patterns in the Light of Lambda Expressions - Venkat Subramaniam
It was pretty good. An eyeopener was replacing Autoclosable with Lambdas, that was fun.
Java Next - From Amber to Loom, from Panama to Valhalla - Nicolai Parlog
Great overview of what's coming.
Effective Developer Testing: taking it to the next level - Maurício Aniche
He had some thoughts on tests that I didn't think of before.
Modern and Lightweight Cloud Application Development with Jakarta EE 10 - Ivar Grimstad
I always like to keep up to date with Jakarta.
Keep your dependencies in check - Marit van Dijk
Dependencies, who doesn't hate them.

Things I would like to have attended, but will probably at some point look them up on the YouTube:

Supercharge your Native Image applications 🚀 - Alina Yurenko
Really interested in this, since I'm using GraalVM in my hobby projects. Unfortunately cannot go native at the moment, as lots of it is dynamic.
Threading the needle: multithreading with project Loom - Marcel Ton
Sounded interesting, but I don't do much with threads (which is the safe bet, honestly).

And that's about it.

References

NLJUG - JFall 2022
http://jfall.nl/

Thursday 3 November 2022

Maven: Where did it come from?

Just a small note.

So, I started using StringUtils in my code. It's from the apache.commons.lang3 package.

Then I noticed that I am not actually using this dependency in my pom.

So I'm using a transitive dependency, which is basically a bad habit, as this transitive dependency can suddenly change.

So I need to find which transitive dependency it is, and add it to my local pom, just to be sure.

The Maven dependency in question is:

org.apache.commons:commons-lang3:3.4

A little research and it turns out mvn dependency:tree is very nice.

You get something like:

So, as it turns out commons-lang3 is a transitive dependency of info.blii.wiki:bliki-core:jar:3.1.0

Well, that's a relief, that is.

References

StackOverflow - In Maven 2, how do I know from which dependency comes a transitive dependency?
https://stackoverflow.com/questions/34144/in-maven-2-how-do-i-know-from-which-dependency-comes-a-transitive-dependency