Circular Dependency Solution
Posted
by gfoley
on Stack Overflow
See other posts from Stack Overflow
or by gfoley
Published on 2010-04-07T22:54:18Z
Indexed on
2010/04/07
23:03 UTC
Read the original article
Hit count: 405
Our current project has ran into a circular dependency issue. Our business logic assembly is using classes and static methods from our SharedLibrary assembly. The SharedLibrary contains a whole bunch of helper functions, such as a SQL Reader class, Enumerators, Global Variables, Error Handling, Logging and Validation.
The SharedLibrary needs access to the Business objects, but the Business objects need access to SharedLibrary. The old developers solved this obvious code smell by replicating the functionality of the business objects in the shared library (very anti-DRY). I've spent a day now trying to read about my options to solve this but i'm hitting a dead end.
I'm open to the idea of architecture redesign, but only as a last resort. So how can i have a Shared Helper Library which can access the business objects, with the business objects still accessing the Shared Helper Library?
© Stack Overflow or respective owner