Data modelling circular dependency

Hi can anyone explain me what is the circular dependency in data modelling and how we can get rid of that.

Second question what are the primary best practices while creating the data modelling.

Hi,

An example of a circular dependency in your data model would be to have a table with a mandatory foreign key to another table with a mandatory foreign key to the first table, meaning that it makes it very complicated to insert records in either of them - you should avoid these.

Data modelling is a huge topic in itself, but stick with a consistent naming scheme, try to describe all Entities and their attributes and remember these:

https://success.outsystems.com/Documentation/Best_Practices/Performance_Best_Practices/Performance_Best_Practices_-_Data_model

you will not have circular dependencies if you put both entities in the same _CS.

Solution

Circular Dependencies occurs when Module A consumes part or Module B while Module B consumes part of Module A. To fix this you should check if A and B are strongly link together. If No, then just move the part being consumes to the proper module. If Yes, you should get all the parts that are strongly link together and but them on a new Module e.g Module AB then link the A and B to that module.

You can also try and use web services to fix circular dependencies but be aware of the pros and cons of using it.


Solution

(Tesi) Marwin Signo wrote:

Circular Dependencies occurs when Module A consumes part or Module B while Module B consumes part of Module A. To fix this you should check if A and B are strongly link together. If No, then just move the part being consumes to the proper module. If Yes, you should get all the parts that are strongly link together and but them on a new Module e.g Module AB then link the A and B to that module.

You can also try and use web services to fix circular dependencies but be aware of the pros and cons of using it.


Thanks Tesi for your comment.

How we can solve the circular dependency by using web services and what are the pros and cons of it.?

Can you elaborate in detail? Thanks in advance.   


Rohan Hanumante wrote:

(Tesi) Marwin Signo wrote:

Circular Dependencies occurs when Module A consumes part or Module B while Module B consumes part of Module A. To fix this you should check if A and B are strongly link together. If No, then just move the part being consumes to the proper module. If Yes, you should get all the parts that are strongly link together and but them on a new Module e.g Module AB then link the A and B to that module.

You can also try and use web services to fix circular dependencies but be aware of the pros and cons of using it.


Thanks Tesi for your comment.

How we can solve the circular dependency by using web services and what are the pros and cons of it.?

Can you elaborate in detail? Thanks in advance.   


You can view the pros and cons here:

https://success.outsystems.com/Documentation/Best_Practices/Performance_Best_Practices/Performance_Best_Practices_-_References#Evaluate_Local_Web_Services_v._Public_Actions


If you have 2 data modules that have dependencies to each other, this usually means you have misplaced some of your tables or you have tables in one of the modules that should be placed to a new 3rd data module.


I don't see how webservices could solve your problem. If you have a need to combine your data, this should be done in another module, not your datamodule but a business layer.