Using Object-Oriented Development

The framework provides the basic constructs of inheritance and encapsulation from object-oriented programming and applies them to presentation layer development.

For example, components are encapsulated and their internals stay private. Consumers of the component can access the public shape (attributes and registered events) of the component, but can't access other implementation details in the component bundle. This separation gives component authors freedom to change the internal implementation details and insulates component consumers from those changes.

Inheritance in Aura components doesn’t work the way it does in Apex or Java. Using inheritance in Aura makes your code harder to understand as the behavior isn’t always intuitive. When possible, use composition instead of inheritance.