News for hackers. Stuff that matters.
Re:Composition, Inheritance, and Liskov Substitution Principle by linguae on Tuesday April 22, 2025 @07:01PM (#43767094)
Coincidentally, I just taught composition over inheritance this morning in my class on object-oriented programming in C++ at Ohlone College in Fremont, CA, and gave an example of why it is undesirable for a stack implementation to inherit a linked list as opposed to just having a linked list as a member. We will learn the SOLID principles of object-oriented software design on Thursday. I may end up passing along this article to my students. Thanks for sharing!
Re:Composition, Inheritance, and Liskov Substitution Principle by johnjr on Tuesday April 22, 2025 @07:05PM (#43767109)
Hi @linguae, The video in the post, originally presented by Barbara Liskov, is a very interesting resource on this topic. Let me know if your students want to discuss this in more detail, and please share their ideas!