What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hey, I have a code design question. As per this article
Hey, I have a code design question. As per this article
https://documentation.spryker.com/docs/ht-extend-inuse-core
Bridges are for core-level only. If you use them at the project-level, you are doing it wrong!
Is this a general rule, that should be respected in any case? We use them at project-level and it really helps in some situations.
Comments
-
the idea behind bridges in core is to remove direct dependencies of modules on each other. AFAIK projects does not have this issue so there is no practical use of bridge modules there
0 -
what's yours approach though?
0 -
We use bridges to decouple modules in project-level the same way as on core-level.
0 -
so you got a multi-repo project?
0 -
No, only one
0 -
then it sounds like an overhead to me. What do you achieve with such decoupling within same codebase?
0 -
The same as with vendors: Modules can be removed or changed with a minimum of pain regarding depending modules.
0 -
so you create bridge module for each custom module you add into project?
0 -
No, only for modules, that need functionalities of another module. So basically we end up with only a few bridges in the end.
0 -
So as I understand it is deemed unnecessary overhead, however not a design fail?
0 -
for your own code there are no strict restrictions, you can have as much abstractions as needed. The article suggests direct usage of facade methods when core functionality is overridden
0 -
Thanks. Any Spryker dev who is willing to comment on this? π
0 -
Ievgen is one of us π
Having βBridgesβ on project level and enjoying them - is a sign of over-engineering. Same as introducing interfaces for every class. How often on your project (really) are you expecting to change Products/categories/put_your_module_here with something else?0 -
in Spryker core the goal is to keep everything decoupled and flexible because we have hundreds of different customers with their unexpected needs, but on a single concrete project the goal is usually the opposite - you take what you need and couple it together.
0 -
On practice, you need to evaluate the following: extra-complexity which is coming with Bridges and additional abstraction layers - hits code readability, debugability and clearness. Which means more error-prone code with more time spent once you need to change it. As an advantage, you can replace one implementation of a module (in theory) with another one..
0 -
my experience and practice show me, that the best approach is to keep it simple and as much readable as possible continuously refactoring the code once needed vs. introducing extra layers of abstractions.
0 -
Similar question. What about the -connector modules which we can find in spryker vendor? Should we use same structure in our codebase or is it an overhead also?
0 -
Thanks @UKJSE6T47 @ULSLLNL7K
0 -
@U0134CBTUKS similar to the bridges, you donβt need to introduce connectors on the project
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random