Zero, one, or many?
Rob

Rob @robc79

About: Long time programmer, wargamer, and painter of miniature things.

Location:
England
Joined:
Sep 17, 2024

Zero, one, or many?

Publish Date: Sep 17 '24
0 0

Cardinality is an issue that comes up frequently in software design. How many of each thing should there be in your system? Over time I have found the maxim zero, one, or many to be a great guide in this area. This boils the problem down to two questions:

  • Do we need the thing at all?
  • Is there going to be more than one of them?

In my experience if a design limits something to three instances, as soon as you ship your product there will be a need for it to allow four. If you find yourself specifying specific cardinalities, tread carefully. Consider if such limits are really necessary. There may be more value in being flexible.

Comments 0 total

    Add comment