473,799 Members | 3,098 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3653
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****@discussi ons.microsoft.c om> wrote in
message news:3C******** *************** ***********@mic rosoft.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****@discussi ons.microsoft.c om> wrote in
message news:3C******** *************** ***********@mic rosoft.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******** ******@TK2MSFTN GP14.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****@discussi ons.microsoft.c om> wrote in
message news:3C******** *************** ***********@mic rosoft.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
410
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 classes. Most relationships exist within one assembly, but relationships between assemblies may sometimes occur. For each relationship, I have to make sure that an object from Class1 knows that it can have an object from Class2 as one of its children....
1
6473
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 my WebMethod I Initialize my project as following:
11
9056
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 object model that includes a container object, and the object in the container need to interact with the container itself. The problem is that, to access the container, each item needs a reference to the container, and that constitutes a...
6
2831
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 stumped again with this little love triangle. Here is some background: m_commands.h defines - struct command_callbacks, which contains - a struct conn * reference - struct command, which contains - a struct command_callback reference
4
3286
by: Henke | last post by:
I have this scenario. public class A { public int numbers; public class A() { }
12
7064
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 issues that I am not seeing (performance wise or garbage collection wise) with circular references? Thanks.
6
5081
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) in search (no record) mode. When the search is executed, frmperson calls frmsearchresult (dim f as new frmsearchresult) which is a listing of persons. From frmsearchresults, frmperson is called (dim f as new frmperson) with the resulting...
2
12012
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 do to find the source of the problem would be appreciated. Thank you Jeremy
3
2928
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 better than the amount of errors I was originally getting on builds before I consilidated by UC's though :-) "Paul Hale" wrote:
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10484
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10228
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9072
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.