method names with fluent interface
fluent-interface, java, naming, scala
Solution
`set{Property}` is better than just {property} for conveying intent. However since your examples are simple boolean properties, an even better fluent interfance might be:
somePermissions.AllowRead().DenyWrite().AllowExecute();
Problem
I have a `Permissions` class in Java with methods in fluent style like this: ``` somePermissions.setRead(true).setWrite(false).setExecute(true) ``` The question is, whether I should name these methods `set{Property}` or only `{property}`. The latter would look like this: ``` somePermissions.read(true).write(false).execute(true) ``` If I look at these methods separately I would expect that `read` reads something, but on the other hand it is closer to the intention to have something like named paramaters like in Scala: ``` Permission(read=true, write=false, execute=true) ```