= Stackable trait modification
= Stackable modification by a trait
{synonym}
A <Scala> trait can intercept a method, call the next implementation through `super`, and add behavior before or after it. `abstract override` marks such an implementation as requiring an appropriate concrete method later in the class linearization. A character-counting plugin can update its cached counts only after a successful underlying document edit, preserving its additional <representation invariant> without changing the edit's abstract result.
Back to article page