Skip to content

Instantly share code, notes, and snippets.

class Item {
String name
Double price
}
class Cart {
Map items = [:]
Cart addItem(Item item) {
items[item.name] = item
@bgoetzmann
bgoetzmann / AxonTutorial.groovy
Created August 30, 2018 11:00
A Groovy script for playing with Axon Framework; it takes back the code presented in "A Guide to the Axon Framework", https://www.baeldung.com/axon-cqrs-event-sourcing.
// See "A Guide to the Axon Framework", https://www.baeldung.com/axon-cqrs-event-sourcing
@Grab('org.axonframework:axon-core:3.3.2')
import org.axonframework.commandhandling.AggregateAnnotationCommandHandler
import org.axonframework.commandhandling.TargetAggregateIdentifier
import org.axonframework.commandhandling.model.AggregateIdentifier
import org.axonframework.commandhandling.CommandHandler
import org.axonframework.eventhandling.EventHandler
import org.axonframework.commandhandling.SimpleCommandBus
import org.axonframework.commandhandling.gateway.DefaultCommandGateway
@bgoetzmann
bgoetzmann / gist:8060ea316611d88a3b8d25290127fdca
Last active August 9, 2017 11:27 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.