المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Circular Dependancies!



C# Programming
12-16-2009, 05:13 PM
Hi all,

Design question, I have three library projects, A, B and C.

Project A - error logging class
Project B - properties class with static methods
Project C - eventing class with static methods

Unfortunately, I want project A to use the properties class B, B to use the eventing class C, and C to contain an error logger object, resulting in a circular dependancy:

A B C A

How can I get around / redesign this? I'm a bit of a novice and might be missing the obvious but I don't see how I can use an interface, as C contains an error logging object, it is not passed an error logger as a method parameter.

Thanks in advance, am so confused!