Posts by Niels Dommerholt

Software Architecture in an Agile World

Posted on by  
Niels Dommerholt

"We’re agile! Just build it!" Or on the other hand; "agile does not support Software Architecture so we should stop doing agile". Two very different opinions that you can sometimes hear within the same company. Which one is right? Or are they both wrong? Should we stop doing architecture to be more agile? Why do we even need architecture? In this post I’ll give my view on the matter and hope to inspire you to combine Agile and Architecture in your organisation.

So what is Architecture? I like the quote by Ralph Johnson because it’s a clear and succinct definition:

Architecture is the decisions that you wish you could get right early in a project
— Ralph Johnson

Another quote I like that stresses the importance of thinking ahead:

Big design up front is dumb, but doing no design up front is even dumber
— Dave Thomas

So, according to Johnson and Thomas we want to get some bits and pieces right early in the project. We do want to think ahead before we build something, but we don’t want to fall into the trap of designing a system that, by the time it’s built, won’t fit what the business needs anymore.

On the other hand we have an agile process where we need to deliver something 'of value' to the customer every couple of weeks. How do we reconcile these two, since sitting in front of a whiteboard for days doesn’t really produce anything of direct value to the customer?

Continue reading →

Testing the Architecture: ArchUnit in Practice

Posted on by  
Niels Dommerholt

While many of the architectural challenges we have to deal with are big hard choices, there are also many smaller simpler ones.

From "don’t call repository classes from controllers" to "don’t have cyclic dependencies". In most projects I’ve worked on these are unwritten rules. But why not write them down in a way that we can also see if the rules get broken? Can we test these rules?

Continue reading →

Lightweight Architecture Decision Records

Posted on by  
Niels Dommerholt

As a software engineer you make architectural decisions all the time. Neal Ford calls these software engineers 'accidental architects'. I personally prefer the term implicit architects because I don’t think software engineers doing architecture is in any way an accident or even something you would not want. You’re the expert after all. Decision making is one thing though, how do you document these decisions?

In my current project my function title is Software Architect. I have mixed feelings about this. While it definitely looks good on a resume I actually don’t feel software architect is a function title. Software architect is in my opinion a role, and one that can’t be handled by someone that doesn’t have his or her’s boots on the ground where the software development happens.

This is reflected in many teams where there is an 'architect' that, every now and then, comes down from his golden throne in his lofty ivory tower to enlighten the code monkeys software engineers with his architecture. After enlightening the engineers he again ascends the thousand stairs to his throne to work on his next perfect work.

Another word for this is a seagull architecture; architects that, like seagulls, fly down cover everything with shit and then fly off again. Leaving the software engineers wondering what they did wrong in a previous life to deserve all this. And if you’re lucky you don’t have a single seagull to deal with, but a whole team of them with conflicting ideas on the direction your teams should take.

Continue reading →

My Move to Kotlin

Posted on by  
Niels Dommerholt

Back in '98 when I started with my CS education Java was the first programming language we were taught. Before I had experimented with QBasic, C and assembly but that was the moment where I started to really grow into being a software engineer. While I made something excursions to other languages; PHP, C#, JavaScript and even ColdFusion, Java always was my 'base' where I returned to. My great love as it were. But now she’s fallen out of fashion and I’m moving on to greener pastures: Kotlin.

You might notice quite a big gap between this post and the previous one. There are multiple reasons for this (a project taking up a lot of my energy is one of them), but a big reason is that in my personal projects I don’t really feel like using Java anymore, but on the other hand Java is the common theme in most of my posts here. This is also reflected in the traffic my blog is getting; the "how to do X" type posts are the most popular.

My definitive move towards Kotlin started in November last year with the (awesome, check them out!) Advent of Code contest of 2017. I use these to challenge myself to learn new things. Back in 2015 I used the challenge to learn Scala and last year I started using Kotlin to solve the 2017 challenges (link if you want to check them out).

While doing the 2017 challenges I was actually having so much fun with Kotlin that I started working on the 2016 challenges as well!

Continue reading →

Serverless Java with AWS Lambda: Introduction

Posted on by  
Niels Dommerholt

Just as we are over the crest of the microservice hype and can finally see how this architectural tool might (or might not) solve our problems the next hype is already here: serverless programming! In this first blog post I’m going to explain what serverless is, what it isn’t, and how it can change the way we create software. In the next posts I’m going to show a few simple examples using a well known 'serverless' platform: AWS Lambda. Originally posted here .

So what is serverless? It’s not uncommon to see developers joke about how silly the term is because there’s obviously still a server right? Of course there is. It’s impossible to run software without a CPU somewhere. So why the name? Well, let’s take a step back in history to how we did things a few decades ago (and how a lot of companies still work!).

Continue reading →

Caching HTTP requests in AngularJS

Posted on by  
Niels Dommerholt

In AngularJS, especially when you’re using a 'modern' Web Component like approach, you often have directives request the same information from your services multiple times. Since we’d rather not do round-trips we don’t need to to save on server resources caching is our go-to solution. In this post I will show two different approaches to caching resources: the built-in angular way using $resource and a home-grown solution.

Original post

Continue reading →

Baking a Blog

Posted on by  
Niels Dommerholt

One of my 2015 New Year’s resolutions was to finally turn my "I should write about this" notes into actual writing. So here we are! My first ever blog post! One of the things holding me back when it came to creating a blog is picking one of the many available blog frameworks, there’s just too many to choose from!  I wanted something that’s easy to use and easy to back-up. Original post

Just this week I ran into JBake completely by accident (we were working with GVM and I just clicked all the links I didn’t know on that page to see what it was about). Before I hadn’t even thought of using a static blog genererator but when I started reading about it, it made perfect sense!

Continue reading →

Antlr is Awesome

Posted on by  
Niels Dommerholt

In this post I will show you how to integrate the Antlr4 parser generator in your Java project to generate a parser and use the parser to parse simple mathematical expressions. It’s a good starting point if you need to do any kind of parsing in your Java project. I’ve also provided a runnable Maven project. Original post

About a year ago I had to implement a query language in a project I was (and currently still am) working on. We’re creating a specialized search engine where users can use a GUI to query the system. Power users need to be able to type in search queries and a requirement for this query language is that it would be both simple and powerful. This led to us ending up with something fairly similar to the where clause in a SQL select statement.

Continue reading →

Code Challenge "Vrolijke Framboos" Postmortem

Posted on by  
Niels Dommerholt

Tuesday we had our second ever "Vrolijke Framboos" (Dutch for Happy Raspberry) Java code challenge at JDriven and it was a blast! This year’s challenge was to create a REST service client that would play a number guessing game with the server. After setting up a session you would guess a number and the server would respond with either "lower", "higher" or "bingo". The goal was to guess as many numbers in the two minutes you’d be given. Given the name of the challenge you can probably guess that the target platform would be a Raspberry Pi!

It was an incredible and fun experience and in this post I want to explain how I approached the challenge and how my solution ended up in the second place, making me just miss the opportunity to take home the trophy and a new Raspberry.

Continue reading →

Communication between Angular Controller and Directive

Posted on by  
Niels Dommerholt

Since I had issues finding a good explanation on how to tie together a controller and a directive with isolated scope I decided to create my own blog post on this subject. This repo contains a runnable example of the solution. It contains a Spring Boot Web Application that can be started to act as a HTTP server but all the interesting stuff is in the src/main/webapp folder.

To create modular code with AngularJS you want to create reusable components; directives. Directives should not depend in any way on the parent controller. They should not be able to see any of the parent scope unless it's explicitly provided to them. To do this Angular directives can have an isolated scope (which in my opinion should be the default). This however leads to an issue: typically a directive needs information provided for them, needs to provide methods that can be called and often also has to fire events that the layers above the directive need to be able to respond to. Especially the latter part, informing the scopes above of changes, is done in a somewhat particular way.

Continue reading →

shadow-left