Jump to content

Software Design/Prohibit overriding implementation of a function

From Wikiversity

Why not

[edit | edit source]
  • Forces to write boilerplate code (and leads to increased code size) when inheriting behavior from abstract classes (e. g. Java's default methods).
  • May lead to some logic duplication between implementations of a function in different classes extending an abstract class: see practice Don't repeat logic in several places.
[edit | edit source]

Sources

[edit | edit source]
  • A De Goes, John (October 26, 2019). "12 Steps to Better Scala". Hamburg, Germany: Scala Hamburg. "Make Methods Final or Abstract"