Development guidelines

The Springbok Common Library Guidelines outline essential standards and best practices designed to enhance the usability, consistency, and accessibility of our library for all users.

Separation of Concerns

  • Ensure a clear separation between extraction, transformation, and loading stages.

  • Follow the single responsibility principle for all classes.

Protected methods

  • Use protected instead of private methods to ensure flexibility and extendability in Spryker projects.

  • Use static keyword instead of self to ensure proper inheritance and late static binding.

Class Names

  • Each class for loader, transformer, and extractor and their plugins should have the same name as the XML tag in the pipeline configuration (ie. <extractor><csv-file filename="..." /></extractor> has plugin class CsvFileExtractorPlugin and extractor class CsvFileExtractor.

  • This ensures consistency and ease of mapping between configuration and code.

Naming conventions for transformers

Transformers which loads data from database should be named with this pattern: LoadXxxTransformer

Examples:

  • LoadCategoryIdsTransformerPlugin

  • LoadStoreIdsTransformer

  • LoadTaxSetTransformer

Configuration

  1. No Hardcoded Fields:

    • Avoid hardcoding any fields in the classes.

    • All fields should be dynamically passed from the pipeline configuration.

    • This increases reusability and adaptability of the ETL components.

  2. Constants for XML Configuration Attributes:

    • Define constants for all XML configuration attributes.

    • Constants should be prefixed with ATTRIBUTE_.

    • For example, an XML attribute targetFieldName should be represented as ATTRIBUTE_TARGET_FIELD_NAME in the plugin classes.

No Business Logic in Loaders

  • Loaders should solely be responsible for writing data.

  • Do not include any business logic in the loader classes.

  • Any data transformation should occur in the transformer classes before reaching the loader.