In addition to providing code generation services, ObjectExtender also provides a way for you to insert your own code into methods created by these services. This open path into the generated code is provided in the event that you have special application requirements that may call for unique processing. In this way, you can take advantage of the services that ObjectExtender provides as well as add your own processing.
Using the user code sections in the generated methods guarantees that your code will remain intact across regenerations of your model. When you regenerate existing code, the code generator will merge the lines you added into the regenerated version of the method.
User code sections in ObjectExtender are delimited in the methods using comments.
methodName "Method comments..." |methodTemporaryVariables | methodCode... "Begin user code {section name}" "End user code"
User code sections are generated in the following classes:
User code sections are generated in the business object, key, and data object classes.
In some cases, specific methods are noted. In other cases, the generic getter/setter terminology is used indicating attribute accessor methods. The names of the user code sections are given in parentheses. These names are found in the comments of the user code section. Think of them as labels for the user code that suggest what is to done at a particular linear section in the code.
accountNumber "Get the value of the attribute accountNumber in the current transaction" | value | value := self bom versionDataForRead primAccountNumber. "Begin user code {post-Get}" "End user code"