Composition

Building an object from smaller parts it owns, instead of inheriting from a parent class.

Think of it as Assembling a robot from standard modules rather than breeding it from another robot.

A drone that owns a Health part, a mover and a stun timer is composed. Each part can be reused by other objects, and you can see everything an object does by listing its parts. Most Roblox codebases prefer composition to deep inheritance chains.

Related terms