Some lazy people make art out of their laziness. Take me for example. Here's my daily schedule:
- 8:00–9:00: Arrive at the office
- 9:00–10:00: Drink coffee
- 10:00–12:00: Attend some meetings or review code
- 12:00–13:00: Go out for lunch
- 13:00–16:00: Attend some meetings or review code
- 16:00: Sneak out home
As you can see, some of the parts of the schedule never change, and some do. At first, I thought I could decorate my changing schedule with that setup and teardown logic, which happens before and after. But then there's lunch, which is holy for architects and happens in between.
Java is pretty clear on what you should do. First, you create an abstract class. All methods that you want to implement by yourself you mark as private:
abstract class DayRoutine {
private fun arriveToWork() {
println("Hi boss...