Introduction
There are two ways to extend ISD-generated base methods:
- Call the base method, and insert custom code before or after the call.
- Cut and paste base method's code, and modify the pasted code.
ISD makes it easier to use the second approach, because the cut-and-paste is done automatically. From code maintenance point of view, however, the first approach is preferred. This is because,
- Custom code is not mixed with ISD-generated code, making it easier to understand and maintain.
- Any changes in the base method are automatically propagated to the override method in the first approach. While in the second approach, you have to redo the customization. It is VERY easy to forget to redo the customization, and result in bugs.
However, it is not always possible to go with the first approach. Sometimes you have to insert your custom code into the middle of ISD code. For some of those cases related to transactions, I have a few tips to offer.
No comments:
Post a Comment