ஆபரணம் பரம்பரைக்கு முந்தையது என்பது பரவலாக குறிப்பிடப்படும் வடிவமைப்பு கொள்கை — அடிப்படை வகுப்புகளிலிருந்து பரம்பரை செய்வதற்கு பதிலாக (பரம்பரை) நடத்தைகளை இணைப்பதன் மூலம் (ஆபரணம்) பொருட்களை உருவாக்குவதை விரும்புவது. பரம்பரைக்கு குறிப்பிடத்தக்க குறைபாடுகள் உள்ளன, இருப்பினும் இரண்டும் அவற்றின் இடம் உள்ளது.
பரம்பரை எதிராக ஆபரணம்
INHERITANCE → a class EXTENDS another, inheriting its behavior ("IS-A" relationship):
class Dog extends Animal
COMPOSITION → a class is BUILT FROM other objects/behaviors ("HAS-A" / uses):
class Car { constructor() { this.engine = new Engine(); } } // composes behaviors
→ composition: combine smaller pieces; inheritance: derive from a parent
