471,325 Members | 1,111 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

How to avoid circular references

VS2005.

It's possible to avoid circular references like in C++?

Feb 14 '06 #1
3 8100
Hello, tomb!

t> VS2005.

t> It's possible to avoid circular references like in C++?

If you mean that object A has reference on B and B has reference on A;
or even A->C->B B->A - then answer is no, beacause it depends on application architecture.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Feb 14 '06 #2
Circular references can sometimes suggest a design flaw. However,
there is a good article on an msdn blog describing the use of a common
interface to resolve the conflict:

http://blogs.msdn.com/nickmalik/arch...18/398601.aspx

Feb 14 '06 #3
tomb,

If you talk about c++ forward declarations , no there is no such a thing in
c#. Using conditional compilation in header files doesn't work for C# either
because metadata are in the assembly itslef.

If two assemblies are referenced each other you need to get the common types
and move them in separate assembly. Then both dll will reference this
assembly. You can also create assembly declaring interfaces for the common
types and use them in your other dlls instead of actual types.
--
HTH
Stoitcho Goutsev (100)

"tomb" <+_***********@gmail.com> wrote in message
news:43**********@x-privat.org...
VS2005.

It's possible to avoid circular references like in C++?

Feb 14 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Earth Worm Jim | last post: by
12 posts views Thread by Frank Rizzo | last post: by
6 posts views Thread by Stephen Robertson | last post: by
3 posts views Thread by John Nagle | last post: by
5 posts views Thread by Madhur | last post: by
3 posts views Thread by =?Utf-8?B?UGF1bCBIYWxl?= | last post: by
2 posts views Thread by Dansk | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.