Skip to content

Customizing ApraPipes Modules for Application‐Specific Changes

Vinayak Y B edited this page Aug 8, 2024 · 2 revisions

In ApraPipes, when you need to implement application-specific changes to a module, the recommended approach is to create a wrapper class around the module and override the necessary methods. This ensures that the custom changes are isolated to the application, while maintaining the integrity of the original module code.

Guiding Principles:

Use Wrappers for Customization: For any application-specific changes, create a wrapper class around the module. Override only the methods where you need to introduce custom behavior. Example: If you need to modify the behavior of the Mp4ReaderModuleClass, create a wrapper like App_Mp4ReaderSource and override the relevant methods.

Maintain Minimal Code Repeatability: Ensure that code repetition is minimized by only overriding methods that require custom logic. The wrapper should leverage as much of the base module's functionality as possible.

Rolling Back Generic Changes: Any generic improvements or fixes should be merged back into the master branch following standard procedures. Keep the custom logic confined to the application-specific wrapper to prevent unnecessary duplication in the master codebase.

Example: If the Mp4ReaderModuleClass in ApraPipes needs to produce data in a specific way for your application, you should:

Create a wrapper class: App_Mp4ReaderSource on the application side. Override the produce method within App_Mp4ReaderSource to introduce the desired behavior. Ensure other methods of the Mp4ReaderModuleClass remain untouched unless required by the application.