what is the definition of a "circular reference"???

Posted on 2006-07-10
Medium Priority
Last Modified: 2012-08-14

We are in the process of transferring our legacy system to asp.net. We have multiple solutions all containing one project each. We have a lot of situations whereby a class in "Solution A" will call a class in "Solution B" and vice versa. Does this constitute a circular reference or does this term only refer to projects which call other projects within the same solution??? We know that visual studio will now build projects which call other projects inside the same solution due to circular references, however we have not run into this error with the multiple solution/one project setup...We are wondering if this setup will cause us any problems down the road? or Should we combine solutions to eliminate these types of calls and be forced to have longer build times???
Question by:pathix
LVL 13

Accepted Solution

devsolns earned 2000 total points
ID: 17075788
Yeah that is pretty much on as far as a circular reference.  Think about this, should a circular reference really exist for code that is in two difference assemblies?  Probably not.  There are things that you can do to avoid circular references such as using interfaces.

-As you can see from the following a circular reference is set between class A1 & B1.  

    class A1
        public void Foo(){}


    class B1
        public void Foo(A1 a)

-The following code removes the circular reference while maintaining/improving functionality.

    interface IFoo
        void Foo();

    class A2 : IFoo
        public void Foo() { }

    class B2
        public void Foo(IFoo a)


Expert Comment

ID: 17075999
A circular reference is caused when the calculation that you are doing uses itself to calculate.
This results in an endless calculation, and gives you an error.

It can happen if you have a query which is dependant on the result of another and then use both of these queries as sources for another query.

Alternatively, it can be caused by naming objects the same - which is why it is important to generate unique names for all objects that follow a specific naming convention.

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
From store locators to asset tracking and route optimization, learn how leading companies are using Google Maps APIs throughout the customer journey to increase checkout conversions, boost user engagement, and optimize order fulfillment. Powered …
To export Lotus Notes to Outlook PST or Exchange and Domino Server files to Exchange Server or PST files with ease, go for Kernel for Lotus Notes to Outlook conversion tool. Through the video, you can watch the conversion process. A common user with…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question