Cyclic reference

Hi community,

At the moment we have a cyclic reference between two modules mentioned by Architecture Dashboard. We are not sure what is the best way to solve this problem. So I hope one of you can guide us in the right direction. In the image below you see a overview of the current situation.

In BrandCoreRange entity we store products that exist in the range of the brand or a division and in Product entity we store products with product information.

Perhaps we have placed the BrandCoreRange entity incorrectly? How do you guys think of this? If more information is needed to provide a good answer, please let me know! 

Thanks,

Bart

Solution

Hi Bart

The best way to solve cyclic reference is

  1. Find the consumed elements(In your case it's BrandCoreRange and Product )
  2. It seems both are business independent and they are in different applications in your case so its not possible to move it to one module.
  3. The best way to solve cyclic dependency is to create a third BL module and Orchestrate these two CS modules by taking the dependency of these two consumed elements and you can write logic in that module that uses both elements and keep that module in another application or in any of one application to solve the application-level conflict. (Go for this as it is the best-recommended solution )
  4. If creating new module is not feasible then expose one as the rest API and consume it so that it was a weak dependency and cycles can be avoided.
  5. For further reference, you can visit this for better understanding https://www.outsystems.com/training/courses/69/refactoring-applications/?LearningPathId=8

Hi Prathoswar,

Thanks for your answer and systematic approach :-)

I also think the 3rd point you mention is the best one in this scenario. If i may ask, where would you place this BL module, since I have two applications (Product Core Services and Brand Core Services)? Personally, I think I should create a third application that sits above these two concepts. Do you agree?

Thanks,

Bart

Hi Bart

Yes, that will work. You can create a new core application above these two applications and place the BL module there. 

Also, you can create a BL module in any one of the applications as that will also help and may avoid creating a new application. It seems both are core applications so no conflict will raise.

Now you can take decisions accordingly as you can create a new application or create a BL module inside any one application.

Thank you

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.