Replies: 3 comments 3 replies
-
I'm probably wrong, my guess it's possible to do as demonstrated in TCA case study example ReusableFavoriting. In other words, Inventory really only needs to know that items it's managing can be stored in an IdentifiedArray. While ItemRow, probably will need to be aware of the Item's shape just enough for its display, which is probably defined by a protocol. |
Beta Was this translation helpful? Give feedback.
-
That episode ending was a big cliffhanger :D I personally don't like at all the vertical modules and we're not using that in our project. Our approach is more horizontal, but that requires often making a "third module" that wraps other two, it's what I call "The third package rule" 😂 I wrote about our approach here iOS App Architecture in 2022. I'm sure they will present us something interesting in some upcoming video ^^ |
Beta Was this translation helpful? Give feedback.
-
I think the correct answer is provided in the TCA's documentation regarding navigation.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I just finished watching the last PointFree episode about modularity (https://www.pointfree.co/episodes/ep172-modularization-part-2) where @mbrandonw & @stephencelis modularize the sandbox app they have been using to demonstrate Navigation helpers.
The discussion at the end of that video about vertical & horizontal dependencies caught my attention as I think I will begin facing some difficulty in modularizing my current project.
Here is the module map of that sandbox app:
Each box represents a distinct module & each column the dependencies between them. We can also see each column as a tab in the app : in the first tab, Inventory presents a list of ItemRow, & each ItemRow leads to an Item screen. So Inventory depends on ItemRow which depends on Item.
Using TCA I can see how it would be possible to modularize an app this way. However the problems start when Item screen should contain a link to Inventory screen maybe because we want a list of relatable items there ;) In this scenario Item would need to depend on Inventory which leads to interdependency loop 🥶
Interestingly enough Brandon & Stephen mention another way of modularizing without creating dependencies between modules :
This would allow us to display Inventory screen from Item screen without even have a dependency between the two modules. However the video doesn't go further than mentionning it's a complex topic. I guess it would require heavy use of protocols to hide the actual types inside the modules and I struggle to see how it can be performed using TCA.
If someone (especially Brandon or Stephen ;) ) has a strategy in mind, or has already tackled the problem, that would maybe give some clues on how I can solve this on my own project.
PS : I hope it's OK to post this here as I think it's an issue many people using TCA with modules will encounter at one point or another :)
Beta Was this translation helpful? Give feedback.
All reactions