

Therefore, to wrap a method that is defined in a base package (such as Application Suite), you must recompile that base package on Platform update 9 or later.Īs an example: If you create your own extension model that is augmenting a class that exists in the Application Suite model, and if you are using CoC or accessing protected methods/variables, you will need to build both Application Suite and your extension model. As of August 2017, all current releases of the applications for Finance and Operations have been compiled on Platform update 8 or earlier.

However, the class that is being augmented must also be compiled on Platform update 9 or later. The functionality that is described in this article (CoC and access to protected methods and variables) is available in Platform update 9. If no more wrapped methods exist, the system calls the original implementation. When the call to the next doSomething method occurs, the system randomly picks another method in the CoC. The system randomly runs one of these methods, such as the doSomething method of the BusinessLogic1_Extension class. When this code is run, the system finds any method that wraps the doSomething method. BusinessLogic1 object = new BusinessLogic1() The pattern supports loose coupling of the sender and the receivers. CoC is a design pattern where a request is handled by a series of receivers. In this example, the wrapper around doSomething and the required use of the next keyword create a Chain of Command (CoC) for the method. An extension class must belong to a package that references the model where the augmented class is defined.

You can now augment the functionality of the doSomething method inside an extension class by reusing the same method name. In this way, you can start transactions and easily manage state variables that are associated with your class.įor example, a model contains the following code. When you wrap a method, you can also access public and protected methods, and variables of the base class. You can extend the logic of public and protected methods without having to use event handlers. You can now wrap logic around methods that are defined in the base class that you're augmenting. The functionality for class extension, or class augmentation, has been improved.
