How to avoid circular references

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tomb

    #1

    How to avoid circular references

    VS2005.

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

  • Vadym Stetsyak

    #2
    Re: How to avoid circular references

    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

    Comment

    • dotnetchic

      #3
      Re: How to avoid circular references

      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

      Comment

      • Stoitcho Goutsev \(100\)

        #4
        Re: How to avoid circular references

        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" <+_prquamurt_+@ gmail.com> wrote in message
        news:43f1e2f6$1 _1@x-privat.org...[color=blue]
        > VS2005.
        >
        > It's possible to avoid circular references like in C++?
        >[/color]


        Comment

        Working...