1. A computer-implemented method comprising: receiving a pattern language code having definitions of a number of classes, wherein a definition of a first class of the number of classes comprises a reference to a first key field, wherein a definition of a second class comprises a reference to a second key field, wherein the first key field references a first external object and the second key field references a second external object, wherein the first external object and the second external object are different external objects, and wherein the first external object is in an ontological relationship with the second external object in order to establish a surrogate relationship; and compiling, using one or more processors, the pattern language code to generate object code, wherein the compiling comprises validating the surrogate relationship between the first and second classes; wherein the surrogate relationship defines a relationship where the second class can functionally replace the first class in the compiled object code.