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
protectedinstead ofprivatemethods to ensure flexibility and extendability in Spryker projects.Use
statickeyword instead ofselfto 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 classCsvFileExtractorPluginand extractor classCsvFileExtractor.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:
LoadCategoryIdsTransformerPluginLoadStoreIdsTransformerLoadTaxSetTransformer
Configuration¶
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.
Constants for XML Configuration Attributes:
Define constants for all XML configuration attributes.
Constants should be prefixed with
ATTRIBUTE_.For example, an XML attribute
targetFieldNameshould be represented asATTRIBUTE_TARGET_FIELD_NAMEin 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.