Posts tagged "Java"

Devoxx 2017

Last updated

Almost two months ago I visited Devoxx 2017. It’s about time to write some notes on the stuff I learnt there!

Event Storming & DDD workshop

The week started off with a full afternoon workshop led by Stijn Vanpoucke. The workshop consisted of small pieces of theory, alternated with exercises using post-it’s and markers.

A few of the theoretic pieces:

  • An event is something that has happened in the past. It is usually phrased in past tense. It should be understandable for business users.
  • A command is an user-initiated action. It explains the origin and sometimes the reason for the action.
  • An entity is an individual thing. It has a unique identity. Often, entities are mutable.
  • A value object is an non-unique value. It is often immutable. Its equality is based on it’s attributes. It should be able to validate itself. They can be combined.
  • An aggregate is a combination of entities and value objects. They are structured in a hierarchy. Its root is always an entity. Aggregates contain business rules. Note that a bigger aggregate is not always better! To circumvent this, aggregates can use soft links based on the unique identity of other entities.
  • The bounded context describes the context from which you look at it. Take a pen as example; what a pen is depends on the context from which you look at it. To stress the fact that it has boundaries, it is called a bounded context. Bounded contexts support the idea of having “one team, one (business) language”. The bigger the bounded context is, the bigger the language, whether artificial or natural. Finally, multiple domains can have different words for the same concept. A sales department might speak of products while inventory management might name the same concept article.

Kotlin for Java programmers

This year had a lot of talks about Kotlin scheduled. To visit them all would take too much time, so I decided to follow just one by Venkat Subramaniam. I figured it would give me about the same amount of content…

Read more... →

Getting Started with Zuul

Last updated

It’s been a while since my last post! I recently have been reading a lot about the idea of “API management” or an “API gateway”. There’s a lot of commercial offerings in this field. Many of them promise you (to some extend) ultimate flexibility and endless possibilities. My preference is for “lean and mean” approaches where I can pick the building blocks that I need. In the long run, that offers more flexibility. After all, you could replace building blocks. Having small building blocks makes it less tempting to put any kind of business logic in such a gateway. Doing that must sooner or later lead to some kind of vendor lock-in.

Read more... →

JavaOne 2017

Last updated

This year, I had the pleasure again to visit JavaOne. Not only did I attend the conference, I was also accepted to speak, which was quite a dream come true. The session catalog contains almost 500 sessions, and I obviously visited only a subset of them. I found two topics particularly interesting and decided to attend multiple sessions on each of them.

“Prepare for JDK 9” and “Migrating to Java 9 Modules”

Both sessions where more or less covering the same ground, although from a different perspective. Alan Bateman from Oracle took the more theoretical view and explained what you can expect to happen when you want to move to Java 9. He also busted some myths, like the one that “nothing will continue to work” or “everything first needs to be modularised”.

Read more... →

JBCNConf & Voxxed Days LU

Last updated

Wow, that was a busy and inspiring week! In one week, I’ve visited two conferences in two different countries to give talks on two different subjects. But the most inspiring part came from attending other sessions. I’ll highlight one session from both conferences.

JBCNConf 2017

On JBCNConf, I’ve attented a session by Burr Sutter about Vert.x. This was a session full of energy, as Burr is really capable of making your enthusiastic of whatever he is talking on. As he walked us through the various options you have to build and deploy Vert.x-based applications, he also showed a lot of demos. One of the demos involved “simple” temperature sensors over MQTT on miniature computers (aside: the size of these computers was largely dominated by their batteries… impressive!) to his MacBook showing you can run Vert.x in multiple languages that still communicate with each other. It also illustrated how to handle events coming in at this pace, introducing the concepts of streaming events.

Read more... →

Verify logging with Logback

Last updated

Sometimes you have a piece of logging that is very important, maybe even part of a business requirement. In that case, you might want to verify that in a unit test, so you can rest assured that this requirement is actually met. How to do that?

Mock it away

A first approach might be to just mock your logging framework in a unit test and verify it was called as you expected. It might sound tempting, and easy to do, but not everybody likes it. And in fact, you might run into some issues when walking this path, because some libraries tend to make classes and/or methods final so they can’t always be mocked away. Also, a lot of people tend to create a logger by doing private static final Logger LOG = ..., which makes it even harder to mock it away. Making your logger an instance variable just so you can test it? Nah…

Read more... →

Blah blah Microservices blah blah

Last updated

As a closing keynote on the second day of Jfokus, Jonas Bonér took the stage under the very clarifying title “Blah blah Microservices blah blah”, which turned out to mean “From microliths to microsystems”.

As a first observation, he stated that no-one really likes microservices. They are kind of a necessary evil - because “doing” microservices comes at a cost. In fact, microservices are just a specialisation of an older concept called distributed systems. But what we often build are microliths - an application that might be called a microservice except for the fact that it lives alone. No failover, no resilience, nothing. But just like actors, microservices should come in systems. And just as important, microservices should come as systems, designed as a distributed system, which each microservice focussing on a single responsibility.

Read more... →

Jfokus, Day 2

Last updated

The second day of Jfokus is just as action-packed as the first one. However, part of the action is me giving two talks. Both of them scheduled today, so a little less time for attending other sessions and blogging about them. I did attend some other sessions after lunch time, on which I’ll report below.

Introduction to Machine Learning

Directly after the lunch, James Ward gave an introduction to machine learning. He started with a very recognizable story about how humans (in casu his daughter) learn new facts about the world around them. Machine learning is in fact no different than human learning: building a model, trying something, seeing whether and how it changes reality and updating the model.

Read more... →

Quickly switch Java versions on macOS

Last updated

Inspired by a Jfokus session I attended today I decided to download and install a preview of Java 9 on my MacBook. That went pretty quick and without much trouble. But when I issued java -version on my terminal, I was greeted with

Java(TM) SE Runtime Environment (build 9-ea+155)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+155, mixed mode)

Although that’s nice - you’d even expect it, maybe - I realised I often need Java 8 as well. How to quickly switch between the two?

Read more... →

Jfokus, Day 1

Last updated

These days, I’m in Stockholm, attending and speaking at the Jfokus conference. Yesterday night was a great opportunity to get to know a few other speakers during dinner. We were even surprised by an act of the Lemon Squeezy barbershop quartet singing for us - very beautiful!

But today, the serious stuff started. In the following sections, I have written down my notes and observations of each of the sessions I attended.

Read more... →

Automatic scan for known vulnerabilities in dependencies

Last updated

When using third-party components (be it open source or not), we all know it’s a good practice to keep your frameworks and libraries up to date. This is also one of the spearhead in the OWASP Top 10 (2013 edition): A9 - Using Components with Known Vulnerabilities. To help you assess your projects status with regard to this, OWASP.org developed the tool Dependency Check. This tool is primarily intended code bases in Java, .NET, Ruby, Node.js, and Python. Integration with various build tools is also provided for.

Read more... →