Now that we know which tools are at our disposal and understand how they can work together, let's put all the pieces together and build our own custom DSL for ordering a meal from a pizza restaurant.
Creating your first Kotlin DSL
What problem are you trying to solve?
When thinking about how to create our DSL, we'll want to consider what syntax we would like to have, as well as what our solution would look like without a DSL. Let's start by imagining what our code might look like without using any kind of DSL.
Without a DSL, we might write code that looks something like this:
val order = Order("123")
order.items.put(Sprite, 1)
order.items.put(Coke, 1)
val pizza1 = HawaiianPizza()
pizza1.toppings.add(Pepperoni...