A Simple REST DSL Part 2
Using a builder to construct a DSL.
In part 1, I showed the builder pattern can improve code readability and composibility of REST requests. Now, let’s discover how the builder can be used as the basis for a simple DSL.
First you need to decide what words or phrases to use to bootstrap the request DSL. Do this by describing some sample requests in simple English and looking for patterns, for example:
Get from url http://api.rest.org/person/ Post personJson to url http://api.