Aller au contenu principal

Prefer composition when roles combine

Choose composition over inheritance when behaviors vary along independent axes.

object-oriented-programming5 min read

The access model has independent variation axes, which makes composition a better fit than more subclasses.

Read the full lesson

Sign up free: one personalized lesson every day, matched to your role and goals.

← Back to library

Nous contacter