Skip to content

Commit f1fdf2a

Browse files
committed
.
1 parent 7f87fc2 commit f1fdf2a

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

content/unroll-default-arguments.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -775,15 +775,28 @@ you to take _any_ `class` or `case class` and evolve it later in a binary compat
775775
### Binary Compatibility for Methods and Classes
776776

777777
Lastly, the above alternatives only solve _half_ the problem: how to evolve `case class`es.
778+
This is _schema evolution_.
779+
780+
Binary compatility is not just a problem for `case class`es adding new fields: normal
781+
`class` constructors, instance method `def`s, static method `def`s, etc. have default
782+
parameters added all the time as well.
778783

779784
In contrast, `@unroll` allows the evolution of `def`s and normal `class`es, in addition
780-
to `case class`es, all using the same approach.
785+
to `case class`es, all using the same approach:
781786

782-
Binary compatility is not just a problem for `case class`es adding new fields: normal
783-
`class` constructors, instance method `def`s, static method `def`s, etc. have default
784-
parameters added all the time as well. `@unroll` solves all these problems at once,
785-
using the same implementation and same user-facing semantics.
787+
1. `@unroll`ing `case class`es is about _schema evolution_
788+
2. `@unroll`ing concrete method `def`s is about _API evolution_
789+
3. `@unroll`ing abstract method `def`s is about _protocol evolution_
790+
791+
All three cases above have analogous best practices in the broader software engineering
792+
world: whether you are adding an optional column to a database table, adding an
793+
optional flag to a command-line tool, are extending an existing protocol with optional
794+
fields that may need handling by both clients and servers implementing that protocol.
786795

796+
`@unroll` solves all three problems at once - schema evolution, API evolution, and protocol
797+
evolution. It does so with the same Scala-level syntax and semantics, with the same requirements
798+
and limitations that common schema/API/protocol-evolution best-practices have in the broader
799+
software engineering community.
787800

788801
## Minor Alternatives:
789802

0 commit comments

Comments
 (0)