Home » JVM Languages » Kotlin » Page 2

Kotlin

Flows can do anything

In Corda, Flows can do a lot more than proposing new transactions to record between organisations. Although, saying they can do anything is probably a bit far-reaching (it’s catchy though). What I really want to say, is that flows are the entry points into a node. Corda provides a series of functions to interact with a node via RPC. Currently, ...

Read More »

Broadcasting a transaction to external organisations

There is a misconception that Corda cannot broadcast data across a network. This is simply wrong. In fact, Corda can send anything between nodes in a network. What Corda does not do, is share unnecessary data (transactions) with nodes that have nothing to do with an individual interaction. Privacy by default is a central component of Corda’s design. Compared to ...

Read More »

Class delegation in Kotlin

In software engineering, the delegation pattern is an object-oriented design pattern that allows object composition to achieve the same code reuse as inheritance. Yes, that is a textbook copy and paste from Wikipedia. I went for that quote as an opening as it is a concise description of the Delegation Pattern. Favouring composition over inheritance is something that is recited ...

Read More »

Extending Flows to customise transaction validation

Through the use of flow extension, nodes running the same CorDapp can include extra validation to ensure that a transaction meets their specific requirements. The validation inside contracts focuses on the rules that must be adhered to by all transacting parties. Because of this, they are more general and focus on ensuring that no one is putting together invalid transactions. ...

Read More »

Running a Kotlin class as a subprocess

Last week I wrote a post on running a Java class as a subprocess. That post was triggered by my need to run a class from within a test without prebuilding a Jar. The only difference between what I wrote in that post and what actually happened was the language. I used Kotlin to write that test. Not Java. Therefore, ...

Read More »

Preventing invalid spending of broadcasted states

Corda is super flexible and will allow you to put together the code needed to write many complex workflows. This flexibility does come with one disadvantage. You, the developer, need to spend some time and thought on designing your application. No more blank contracts. No more responder flows that sign anything they receive. You’ll be glad you put in the ...

Read More »

Kotlin vs Scala: which is right for you?

Kotlin or Scala? Scala or Kotlin? The two contenders for the crown of the JVM Kingdoms and the title of “Better Java” each bring something unique to the fight. But which should be the next ruler of your code? Java is old. Not that there’s anything wrong with being old. Sometimes it can be a good thing. Math is old ...

Read More »

Kotlin primitive and object arrays

I initially set out to write this post because I was playing around with some reflection code and thought I found something interesting. Alas, that was definitely not the case. Instead, it was just a basic feature of Kotlin that I haven’t needed to use or focus on yet. Although this post didn’t turn out the way I wanted it ...

Read More »