Timeline for How to easily avoid circular dependencies
Current License: CC BY-SA 4.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 21, 2024 at 10:51 | comment | added | Ewan | @Mars the rule should guarantee a tree structure with no loops, which are obvs a danger if you have services calling services as in this case. i would put a logging service in the data layer myself. the application layer name comes from clean arch i believe, but its just an extra layer where you can put the "mashaling of services" logic and maintain the rule. Obvs you can have two things on the same layer call each other, but if you can avoid it then you have "an easy way to avoid circular dependencies" | |
| Feb 21, 2024 at 7:34 | comment | added | Mars | Side question--I've been asked and couldn't answer before, but in my experience, it's common to use Services in MVP, MVC, MVVM, etc. But does that make it a new/separate pattern? | |
| Feb 21, 2024 at 7:32 | comment | added | Mars | Curious about what your Application layer is though--I've never heard the term used in a MPC architecture. | |
| Feb 21, 2024 at 7:31 | comment | added | Mars | Not one of the downvoters, but it's very common for services to use other services. Or do none of your services use a logging service? ;p | |
| Feb 21, 2024 at 0:55 | comment | added | Paŭlo Ebermann | We don't yet have a definition of "circular dependency". From what I read in the question, Rui might want that the dependency-graph is a tree, which would not be guaranteed by the level-x+1-constraint you are suggesting. | |
| Feb 20, 2024 at 19:50 | comment | added | Ewan | You would avoid compile time circular references, but here the OP is obvs asking about a more complex situation. Dunno why i get 6 down votes for basically a simple premise in most popular architectures and a sure fire way to avoid any issues for beginners | |
| Feb 20, 2024 at 19:45 | comment | added | Richard Tingle | This answer might be better if it addressed why that would be worth it? You could equally avoid circular dependencies by putting all your source into a single giant class but I don't think that would be worth it and isn't a good idea. | |
| Feb 20, 2024 at 11:33 | comment | added | T. Sar | I'll be honest - this looks like a nigthmare to maintain | |
| Feb 19, 2024 at 20:50 | history | edited | Ewan | CC BY-SA 4.0 | added 341 characters in body |
| Feb 19, 2024 at 20:44 | comment | added | Ewan | Since someone needed any easy way to avoid "circular dependencies" | |
| Feb 19, 2024 at 19:10 | comment | added | Doc Brown | Since when is it wrong to have references inside one layer? | |
| Feb 19, 2024 at 18:30 | history | answered | Ewan | CC BY-SA 4.0 |