Commenting and Injection: OM Best Practices - tsgrp/OpenMigrate GitHub Wiki
OpenMigrate is designed to handle a wide variety of use cases, thus, some classes may contain a large number of injectables to configure how that particular bean will work for a particular migration. The ease of configuring OM depends largely on ensuring injectables are properly commented throughout the whole codebase. Use the following best practice tips when adding or modifying injectables in Sources, Targets, Listeners, or anything else you may be adding to OM.
- Declare setters and property definitions next to one another, ie
/**
* OPTIONALLY injected, if true then we get properties from queue onto the node.
*/
public void setGetPropertiesFromQueue(boolean value) {
this.getPropertiesFromQueue = value;
logger.info("injected GetPropertiesFromQueue=" + value);
}
protected boolean getPropertiesFromQueue = false;
- specify whether or not the injectable value is REQUIRED or OPTIONAL
- Injectable setters and member variables should be defined at the TOP of the class.
- All injectable setters should have a comment explaining its usage!