The DRY Principle

Back to Concepts

The DRY1 principle was formulated by A. Hunt and D. Thomas in their book "The Pragmatic Programmer : From Journeyman to Master", and is one of the most important programming concepts. DRY stands for "don't repeat yourself". The principle puts forward the idea that any piece of knowledge in an information system should be represented by a single, unambiguous and authoritative definition. Knowledge includes not only code, but also other elements such as database schemas, versions and even documentation.

The main argument for this principle is that if the same piece of information is represented in two or more ways in a system, in time these representations will likely diverge. Even if they remain consistent, they will have to be perpetually maintained in parallel whenever a change is made. Following the DRY principle reduces the replication of logic and code, which are sources or errors and ambiguities, thereby making the code flexible and easier to understand and maintain. The best development practices and the design patterns support this concept.

Rep ++ intrinsically applies the DRY principle because all the metadata are centralized in the Rep++ model. The metadata are uniquely defined and, through model execution, are reused by all applications of an information system. Rep++ is therefore a valuable tool to help you create quality applications that support the DRY principle.


1. Andy Hunt and Dave Thomas, The Pragmatic Programmer: From Journeyman to Master, (Addison-Wesley, 1999).