473,396 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Circular Reference Problem

Hi All,

I am here with a Query and need a Solution for it.

The Query is as Follows,

We have 3 Projects in a Solution - Say UI, CMN and PRD

First One Deals with UI Forms
Second One Deals with Common Functions that are needed for the Solution
And third One is for Product Specific Database Part.

Here the Last two are Class Library (Dlls) Projects which are Used in UI
Project.

And CMN Dll is Used in PRD Project too.

As of here, there is no Problem in Our Solution.

Now we are in a Need to Use PRD Dll in CMN which results in Circular
Reference Problem.

So We need a Solution to Avoid Circular Reference Problem Since as our
Product grew there may be Too Many Cross References.

Let me Know If any one have any Specific Solution for this Scenario.

Thanks In Advance
Nov 21 '05 #1
3 3622
I get round this problem by loading the dll using reflection at runtime ...
This gets round the requirement to add the reference, though you do lose
intellisense when programming as it's just an "object".

Hope this helps
Simon
"Solution Seeker" <Solution Se****@discussions.microsoft.com> wrote in
message news:3C**********************************@microsof t.com...
Hi All,

I am here with a Query and need a Solution for it.

The Query is as Follows,

We have 3 Projects in a Solution - Say UI, CMN and PRD

First One Deals with UI Forms
Second One Deals with Common Functions that are needed for the Solution
And third One is for Product Specific Database Part.

Here the Last two are Class Library (Dlls) Projects which are Used in UI
Project.

And CMN Dll is Used in PRD Project too.

As of here, there is no Problem in Our Solution.

Now we are in a Need to Use PRD Dll in CMN which results in Circular
Reference Problem.

So We need a Solution to Avoid Circular Reference Problem Since as our
Product grew there may be Too Many Cross References.

Let me Know If any one have any Specific Solution for this Scenario.

Thanks In Advance

Nov 21 '05 #2
I suspect that this is not what you want to hear, but I would look again at
why your CMN project requires access to your PRD project.

If you have a circular dependency then it suggests a flaw in your design. If
the CMN project contains common functions and classes, I would not expect it
to need specific access to the PRD project. If you have recently added a
class or function to CMN that references something in PRD, then perhaps you
should consider putting it in PRD.

HTH

Charles
"Solution Seeker" <Solution Se****@discussions.microsoft.com> wrote in
message news:3C**********************************@microsof t.com...
Hi All,

I am here with a Query and need a Solution for it.

The Query is as Follows,

We have 3 Projects in a Solution - Say UI, CMN and PRD

First One Deals with UI Forms
Second One Deals with Common Functions that are needed for the Solution
And third One is for Product Specific Database Part.

Here the Last two are Class Library (Dlls) Projects which are Used in UI
Project.

And CMN Dll is Used in PRD Project too.

As of here, there is no Problem in Our Solution.

Now we are in a Need to Use PRD Dll in CMN which results in Circular
Reference Problem.

So We need a Solution to Avoid Circular Reference Problem Since as our
Product grew there may be Too Many Cross References.

Let me Know If any one have any Specific Solution for this Scenario.

Thanks In Advance

Nov 21 '05 #3
I don't know about the OP problem, but I have a similar problem which
whilst I could re-engineer with an extra dll that both projects refer to, I
have used reflection to get around the problem.

One example I have is as follows (just to show the validity) :

I have a "customer" object that contains a form that displays customer
history. Within customer history, I have sales history. To get a copy of a
sales invoice, I need to instantiate a salesinvoice object which has a "copy
invoice" function that I call from within the Customer history.

However, in order to get a copy of an invoice from within the sales history,
I need to create a customer object to get the customers name and address
details!

I could put the copy invoice function in another dll, but then this would
need access to the Salesinvoice and customer objects - I would still have a
circular reference... Or maybe I've just completely mis-designed my class
library layouts! (You've got me thinking now!)

Regards
"Charles Law" <bl***@nowhere.com> wrote in message
news:uI**************@TK2MSFTNGP14.phx.gbl...
I suspect that this is not what you want to hear, but I would look again at
why your CMN project requires access to your PRD project.

If you have a circular dependency then it suggests a flaw in your design.
If the CMN project contains common functions and classes, I would not
expect it to need specific access to the PRD project. If you have recently
added a class or function to CMN that references something in PRD, then
perhaps you should consider putting it in PRD.

HTH

Charles
"Solution Seeker" <Solution Se****@discussions.microsoft.com> wrote in
message news:3C**********************************@microsof t.com...
Hi All,

I am here with a Query and need a Solution for it.

The Query is as Follows,

We have 3 Projects in a Solution - Say UI, CMN and PRD

First One Deals with UI Forms
Second One Deals with Common Functions that are needed for the Solution
And third One is for Product Specific Database Part.

Here the Last two are Class Library (Dlls) Projects which are Used in UI
Project.

And CMN Dll is Used in PRD Project too.

As of here, there is no Problem in Our Solution.

Now we are in a Need to Use PRD Dll in CMN which results in Circular
Reference Problem.

So We need a Solution to Avoid Circular Reference Problem Since as our
Product grew there may be Too Many Cross References.

Let me Know If any one have any Specific Solution for this Scenario.

Thanks In Advance


Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Vera | last post by:
I have two assemblies that each consist of several classes. Each object instantiated from those classes can have one or more child- and/or parentobjects that are also instantiated from those...
1
by: dotnetnewbie | last post by:
Hi all I am new to .NET and webservice so I wish someone can shed some light on me. I have a Project class and a Product class, the Project can contain multiple Products (as an ArrayList). In...
11
by: Steve Jorgensen | last post by:
I just came up with a really tidy little solution to the VB/VBA circular reference issue. It only works with Access 2000 or newer, but that's about the only down-side. The issue... You need an...
6
by: T Koster | last post by:
After a few years of programming C, I had come to believe that I finally knew how to correctly organise my structure definitions in header files for mutually dependent structures, but I find myself...
4
by: Henke | last post by:
I have this scenario. public class A { public int numbers; public class A() { }
12
by: Frank Rizzo | last post by:
I have a circular reference between 2 classes in the same project (i.e. each class refers to the other). The app runs fine and I am seeing no issues, which kind of surprised me. Are there any...
6
by: Stephen Robertson | last post by:
We are currently in a dead end with a circular reference issue using vb.net, and are hoping someone might help us resolve it. Idea... We have frmmain calling frmperson (dim f as new frmperson)...
2
by: Jeremy Kitchen | last post by:
I have inherited a project and I am trying to figure out why the failing units tests that exist fail. I a, getting the following error when I attempt serialization. Any advice on what I should...
3
by: =?Utf-8?B?UGF1bCBIYWxl?= | last post by:
Moving all User Controls to a single directory has solved my problem - Thanks Eliyahu. That said, I still got one Circular ref error yesterday, rebuilt again and the build was fine? Far far...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.