Category Archive for "Inheritance"

Understanding and Avoiding Object Slicing in C++

When working with inheritance in C++, it's important to understand the concept of object slicing and how it can affect your program's behavior. Object slicing occurs...

Is List a subclass of List? Why are Java generics not implicitly polymorphic?

Java generics provide a way to parameterize types on classes, methods, and interfaces. They allow us to create classes and methods that can work with different types without sacrif...

Understanding the Nuances of Scope Prototypal / Prototypical Inheritance in AngularJS

When working with AngularJS, one of the key concepts to understand is the scope and its inheritance. Scopes are an integral part of the AngularJS framework and allow for the creati...

Prefer composition over inheritance? Exploring the Trade-Offs of OOP Approaches

In object-oriented programming (OOP), two common approaches for code reuse and structuring are inheritance and composition. Both approaches offer advantages and trade-offs, and und...

How to Represent Inheritance in a Database

In object-oriented programming, inheritance allows us to define a class based on another class. This concept is useful when we want to represent a family of objects with shared att...