Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Service contracts for depending modules #16

Open
Serializator opened this issue Apr 19, 2019 · 0 comments
Open

Service contracts for depending modules #16

Serializator opened this issue Apr 19, 2019 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Serializator
Copy link
Contributor

Service contracts allow depending modules to depend on the interface of the redirect model and it's respective repository instead of its concrete implementation.

Service contract design patterns | Magento 2 Developer Documentation

Interfaces can also be used in classes owned by the module itself to keep a clean and more readable codebase by using the repository interface instead of a factory or collection for example to load one or more redirect models directly.

Suggested interfaces
WeProvide\NginxRedirect\Api\Data\RedirectInterface
WeProvide\NginxRedirect\Api\RedirectRepositoryInterface

@Serializator Serializator added enhancement New feature or request help wanted Extra attention is needed labels Apr 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant