Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-07-10
2
Medium Priority
?
986 Views
Last Modified: 2012-08-14
Hi,

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???
0
Comment
Question by:pathix
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
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)
        {
            a.Foo();
        }
    }

-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)
        {
            a.Foo();
        }
    }



-gp
0
 
LVL 7

Expert Comment

by:RainMan82
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.
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

705 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