JDriven Blog

DataWeave Delight: Turn string value into array of characters

Posted on by  
Hubert Klein Ikkink

A string value can be seen as an array of characters and if we want to transform our string value to an array we can use the toArray function in the dw::util::Coercions module. Once we have transformed our string to an array we can use all functions that work on arrays. The nice thing about DataWeave is that some functions that work on arrays already have an overloaded version that accepts a string value. Then we don’t have to explicitly use the toArray function, but we can simply use our original value when we invoke the function.

Continue reading →

DataWeave Delight: Using string interpolation

Posted on by  
Hubert Klein Ikkink

In DataWeave we can use expressions in strings that will be evaluated and inserted into the string value. This is called string interpolation. The expression must be enclosed in parentheses where the first parenthesis is prefixed with a dollar sign: $(<expression>). The expression must return a string value or can be automatically coerced into a string value in order for it to work. The expression can also be a variable.

Continue reading →

How to get an ActorContext from Akka testKit

Posted on by  
Tammo Sminia

In Akka Typed we need an ActorContext to create new actors.

This poses some problems if we want to create an actor inside a class that’s not an actor. We can pass around an ActorContext from a (higher level) actor. But if this is a longer-lived class, we have to keep in mind that this ActorContext is only valid during construction. So it’s generally frowned upon to pass around the ActorContext.

Continue reading →

Setting up Azure Devops Pipelines for your Kotlin projects

Posted on by  
Alexander Chatzizacharias

Azure DevOps seems to be getting quite popular. All .NET projects I have worked on last couple of years use it, which is quite understandable since it is made and maintained by Microsoft. But also in the world of Java/Kotlin, Azure DevOps is becoming an excellent choice. Maybe Microsoft loves Java after all! A DevOps service isn’t a DevOps service without some solid CI/CD tooling. Azure DevOps’s CI/CD tooling is called Azure Pipelines. So how do you set up an Azure Pipeline for your Kotlin project? Fortunately, its quite simple.

Continue reading →

Smart constructors in Kotlin

Posted on by  
Ties van de Ven

Making illegal states unrepresentable is a good engineering practice. To do this we want to add checks before object creation to make sure it is created in a correct state. Throwing exceptions in the constructor would work for this but it would mean introducing runtime exceptions in your software. If you want to safely create objects without runtime exceptions then smart constructors might be a good solution for you.

Continue reading →

shadow-left