How to deal with cyclic dependencies? #849
                  
                    
                      shwetakawale
                    
                  
                
                  started this conversation in
                General
              
            Replies: 1 comment 3 replies
-
| High coupling of two modules either indicates that they should be a single module or that design needs to be improved. To break the cycles, you have two options: Introduce a third module that depends on the first two or move classes around. In this case, you could remove the dependency from  | 
Beta Was this translation helpful? Give feedback.
                  
                    3 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
There could be situation like
Module A (Order) depends on Module B (Inventory):
Whenever a new order is placed, Module A needs to call Module B to check if the required inventory is available.
Module B (Inventory) depends on Module A (Order):
Module B needs to be notified when an order is placed, updated, or canceled so it can adjust inventory levels accordingly.
but in spring modulith it leads to cyclic dependency, there could many such usecases, is there any way to solve this @odrotbohm
Beta Was this translation helpful? Give feedback.
All reactions