Zero One Infinity

From Wikipedia, the free encyclopedia

The Zero One or Infinity (ZOI) rule is a rule of thumb in software design. It suggests that arbitrary limits on the number of instances of a particular entity should not be allowed. Specifically, that an entity should either be forbidden entirely, one should be allowed, or any number (presumably, to the limit of available storage) of them should be allowed. It should not be the software that puts a hard limit on the number of instances of the entity.

The rationale behind the rule is this. It makes sense to be able to forbid something. And it makes sense to restrict something to uniqueness; the entity in question may have a specific role to play, such that multiple instances would obviously make no sense. However, once the entity is available in numbers greater than one, it usually becomes difficult to justify limiting the number of entities to a particular arbitrary value N. That is, given a particular limit N such that N>1, it is difficult to argue that having a limit of N is any better than N+1. As such, the limit may as well be N+1.

The cases where this rule breaks down tend to be similar to the case of N=1. That is, something intrinsic to the essential nature of the entity makes N of them obviously a reasonable limit, to the point where N+1 would be either non-functional or useless.

[edit] References

http://www.catb.org/~esr/jargon/html/Z/Zero-One-Infinity-Rule.html

Languages