@@ -775,15 +775,28 @@ you to take _any_ `class` or `case class` and evolve it later in a binary compat
775
775
### Binary Compatibility for Methods and Classes
776
776
777
777
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.
778
783
779
784
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:
781
786
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.
786
795
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.
787
800
788
801
## Minor Alternatives:
789
802
0 commit comments