Inheritance Semantics in Go

Contemporary application design discipline is deeply rooted in Object Oriented Analysis and Design and inheritance is a key concept in OOAD. Go does not support classes and inheritance in their classic OOP sense but since many of us are trained in OOP, the loss of an important design concept sometimes feels restrictive.

Even though I knew about embedding and interfaces, their connection with classic inheritance wasn’t quite obvious. I set out to understand how I could emulate the coarse inheritance semantics in Go, without going into fine nuances. That in turn has helped me understand embedding and interfaces in a deeper way and I hope it would help me better design Go types and methods for extensibility.

Continue reading “Inheritance Semantics in Go”