DEV Community

Creating DSL-like API's in Java (and fixing Builder pattern)

Sergiy Yevtushenko on November 05, 2019

In many cases Java DSL is just an way to assemble some complex configuration and then pass built structure to internal method which will handle it....
Collapse
 
siy profile image
Sergiy Yevtushenko

Any DSL requires a lot of thinking. Described approach significantly simplifies building DSL's. And for particular case of replacement of plain Builder it's extremely simple, just some extra boilerplate code.

Collapse
 
rucko24 profile image
0x52

Thanks my big dog.

Thread Thread
 
rucko24 profile image
0x52

updated comment, thanks again...

Collapse
 
nickshoe profile image
nickshoe

I like the simplicity of this example. I find it a good starting point for learning how to build a DSL.