1. A method comprising: accessing validation information maintained in a document associated with an object; using the validation information during runtime to run validation code to determine whether part of the object or data associated with part of the object passes validation or fails validation; and running code of the object if the validation code determines that the part of the object or data associated with the part of the object passes validation, or outputting an error if the validation code determines that the part of the object or data associated with the object fails validation.