1. A 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 field; and compiling the pattern language code to generate an object code, wherein the compiling comprises validating that the field is defined with a context of the first class, the context including a second class of the number of classes that has a surrogate relationship with the first class.