If I have those two projects:
MyCompany.ERP.Billing MyCompany.ERP.Financial
Billing asks/sends information to Financial and vice-versa. Both are too big so I don't want to put them in a single project. Visual Studio doesn't allow circular references. How would you deal with that?
To fix the problem, you can move the formula to another cell. Press Ctrl+X to cut the formula, select another cell, and press Ctrl+V to paste it. You can also try one of these techniques: If you just entered a formula, start with that cell and check to see if you refer to the cell itself.
Circular references aren't a bad thing in itself: you can use them to achieve complex calculations that are otherwise impossible to do, but first you must set them up properly.
%) error message explained. Millions of people using Excel don't get why they see the “circular reference” error message right after they've entered a formula. The message means that your formula is trying to calculate its own cell–kind of like when a dog chases its own tail.
In financial models, the best way to avoid circular references is to build in a “switch” that lets the user toggle between Average Balances and Beginning Balances when calculating items like Interest Income and Interest Expense.
Extract interfaces from your classes and put them into a core project referenced from both Billing
and Financial
projects. You can then use those interfaces to share data between assemblies.
This only allows you to pass objects between those 2 assemblies, but you can't create objects from the other since you don't actually have a reference to begin with. If you want to be able to create objects you need a factory, external to those 2 projects, that handles object creation.
I would extract the business logic that needs to share the data back and forth between Billing
and Financial
into another project. This would make things a lot easier and would save you from resorting to all sort of tricks that make maintainability a nightmare.
Having too large of a project shouldn't be an issue. You can keep your code structured with namespaces and different folders for the source code. In this case circular references are no longer an issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With