circular dependency

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 2 DLLs (Class Libraries). Both defines single-ton objects - logger
object (writes to logger) and application_management object (stores paths and
other things, reads ini file of the application).
Both needs to refer to each other ->
application_management can write to a logger and
logger needs to know the path of logger file.

Of course, it's circular dependency problem.
Please help me to solve this problem!!!!!
 
Hi,

Put the common classes to third assembly that both assemblies will reference
(and this third doesn't reference any of them).
 
Write a wrapper object that refers to each object, or create an interface
that does not require actually referencing the object as an object (Like
remoting).

If you have architected correctly, I see no reason to have a circular
reference.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Back
Top