Tag Archives: dsl

Create your own dsl

In software development I encounter problems with creating user interfaces for manage logical chains.
More complex chain of logic cause more difficult to develop, test, and debug resulting interface.
That interfaces are hard to understand without help of man, who participated in the design.

Instead of complex interface is to try to use DSL.
This require a little more skill from the end user but in return it will eliminate the overloaded ui.
It provide a more flexible control over logic at lower labor costs.
A much easier debugging, testing, and auto-testing.

Consider the example of pethouse. We have the following classes:

class Food {
    Integer size
}
class Pet {
    String name
    Long age
    Closure hello
}
@DSLRoot("pet_house")
class PetHouse {
    String name
    Pet master
    @DSLTypeHint(Pet) List<Pet> pet
    @DSLTypeHint(Food) Map<String, Food> food
}

Continue reading Create your own dsl