2 ms·
Those two patterns aren't the same. You can pass around a half constructed builder but you can't pass around a half constructed public final object like you des
by positr0n 9y ago
Those two patterns aren't the same. You can pass around a half constructed builder but you can't pass around a half constructed public final object like you described.
- dtech 9y agoYou can in most modern or functional languages, by currying/partial evaluation/binding. It's rare for data classes. In scala: case class Foo(a: Int, b: String) val halfBuilt: String => Foo = Foo(1, _) val foo = halfBuilt("foo")