Project development guidelinesEdit on GitHub
Spryker OS exposes codebase projects, which enables a high level of customization and can satisfy complex business requirements.
There are different strategies developers can use to develop projects. Before starting developing, choose a development strategies that meets your requirements. To get maximum from the Spryker OS codebase, atomic releases, leverage minimum efforts for the integration of the new features and keeping system up to date, we recommend the following approaches:
- Plug and play
- Project modules
It is essential to ensure that Spryker is updated to the latest stable version.
Apply coding guidelines
Starting from the first day of development, apply the coding guidelines.
Use custom namespaces
Instead of using the
Pyz namespace, create your own namespace for project development. For example, use the project name as a namespace.
Use custom names
Use custom names for everything that is added on the project level, like the following:
- Transfer properties
- DB tables
- DB table fields,
For example, customize the names by adding the project name.
Avoid using, extending, and overriding Private API
Instead of using, extending, and overriding Private API, send a request about the missing endpoints to your Spryker account manager. Spryker offers extension points that allow you to extend via the Public API and helps you to customize the application. We recommend to use the extension points instead of overriding Private API.
Avoid using unsupported types
Avoid using unsupported types as constructor arguments of a plugin.
The supported types are: null, bool, integer, float, string and object.
Keep modules up to date
During development and after going live, we recommend checking for security updates of external and Spryker dependencies on a regular basis.
Additionally, we recommend keeping modules up to date in general.
Development and tests
Starting from the first day of development, write tests for all the customizations you implement. We provide infrastructure for unit, functional, and acceptance tests.
Starting from the first day of development, we recommend establishing an incremental development process based on CI/CD and the tests mentioned in the previous section.
Establish coding standards
Before you start developing, establish coding standards. Implement code checks based on the standards into your CI/CD. The default code checks shipped with Spryker are located in
/config/install/sniffs.yml. You might want to add more checks that are based on your project’s requirements.
Make sure that code can’t be merged until it corresponds to your coding standards.
Code maintainability is important because it ensures that your code remains understandable, adaptable, and modifiable throughout its lifecycle. It helps development teams to manage and enhance code efficiently, reducing the likelihood of bugs and costly errors over time.
The following tools can help you make your code maintainable:
For submitting the form