We usually use builder pattern in java, like this:
UserBuilder userBuilder = new UserBuilder();
User John = userBuiler.setName("John")
.setPassword("1234")
.isVip(true)
.visableByPublic(false)
.build();
Some of the attributes have default value, and some haven't.
Passing attributes in a map may be a solution, but it makes the argument really longer:
(def john (make-user {:name "John" :pass "1234" :vip true :visible false}))
So, my question is, is there a elegant way to achieve this?