java

Seven tips to be happy as a Java Developer (or at least less sad)

Most Java Developers still are trapped working in Banks. These developers cannot simply stop writing bureaucratic code. If you already identified yourself, unfortunately, this post isn't for you, I'm so sorry, you're completely lost, but don't worry, I'm pretty sure there's a special place in heaven for people like you. On the other hand, there are a few Java developers who could escape the agony of writing "enterprise" Java code and started writing Kotlin, Scala or even a non JVM language. If you are a developer like this…

Keep reading

Building microservices with Kotlin and Spring Boot

It's been a while since Kotlin arrived. Kotlin is a JVM language created by JetBrains developed to be interoperate with Java libraries and apis. What draws attention about Kotlin is its simplicity. If you find Java too verbose, you also will be interested in Kotlin because it is possible to transit between both languages easily. Okay then, this post is supposed to be very short, so, let's begin. We are going to build a simple crud app using Spring Boot, specifically Spring Boot Data Rest and use Kotlin (of course)…

Keep reading

Configuring multiple datasources using SpringBoot and Atomikos

Since I didn't find any article explaining how to use the auto configuration to configure Atomikos on SpringBoot, I decided to write this post. I hope it can be useful to someone. ;) Dependencies Assuming you are developing a web application and want to use Atomikos to provide distributed transactions over multiple datasources, you will need only two dependencies: def springBootVersion = 'YOUR_SPRING_BOOT_VERSION_HERE' compile group: 'org.springframework.boot', name: 'spring-boot-starter-jta-atomikos', version: springBootVersion compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: springBootVersion The application.yml If you are using…

Keep reading

Why you should consider using Apache DeltaSpike

We always hear about the Spring vs Java EE fight. Do we always have to use one of them? For sure, they give you a lot of facilities, but, do we need all of those features that they bring with them every time? Well, actually you don't need to choose one of them always. There are a lot of other alternatives that help you build your applications, so, why not take a look at few of them? I'm here to show an alternative called Apache DeltaSpike. Apache DeltaSpike is a…

Keep reading

Why you should avoid conditional statements

Developers tend to use a lot of conditional statements in their code. Of course, each flow has one specific path, its own specific validations, etc. It is very natural that your code has a lot of decisions to be made at runtime, but, mostly, when you use a lot of conditional statements in specific area of your code, probably you are not using it right. Conditional statements should be used for small decisions, not big decisions, not for choosing one path of five others. (It really hurts to see chained…

Keep reading