By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,578 Members | 1,840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,578 IT Pros & Developers. It's quick & easy.

Circular Reference Problem

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.