3 ms·
It seems most of the examples are builder-pattern like, constructing configuration for the final object. If that's the case, all you really need it something li
by cromwellian 9y ago
It seems most of the examples are builder-pattern like, constructing configuration for the final object. If that's the case, all you really need it something like @AutoValue or the @Value.Immutable from immutables.org
Most of the boilerplate is removed, especially with Immutables.org's annotation processor. Plus, you get immutability and other validation.
- specialist 9y agoYa. Builder, Composite, Method Chaining implementations are (can be) isomorphic. Thanks for the immutables.org link. Amazing. FWIW, I once fudged a UI DSL for AWT/Swing using annotations. It sucked. Too many edge cases requiring shims. Mostly because the underlying UI components were not designed for (clean) composition. Like the OP, I went a little nutty with Fluent APIs for a while. Never again. Now I prefer Builder for small stuff and DSLs for anything interesting. Composite & Intepreter is a potent combo.