Use a fixed-length tuple or vector where each position corresponds to a base unit (e.g., (length, time, mass, ...)). Define constants like:
METER = (1, 0, 0)
SECOND = (0, 1, 0)
METER_PER_SECOND = (1, -1, 0)
This makes operations predictable and easy to validate using basic vector math