|
|
|
|
|
by karmakaze
1202 days ago
|
|
The diamond example "TA extends Student, Teacher" seems worse than OO or direct composition. It's either a compiler error or share everything that overlaps. I would have made the sharing explicit during composition--a Teacher or Student is given the Person instance when constructed, so sharing or not sharing is decided at composition time. To enforce consistency use helper/static methods. |
|