473,474 Members | 1,304 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

circular dependence

I have 2 dlls and they reference each other, thus causing the circular
dependence error. I have read about other cases and people say use
Interfaces to solve the problem with the shared methods. My case is getting
the error, not because methods need shared, but because forms need shared.
Example:
A.DLL has form TestA1, TestA2
B.DLL has form TestB

TestA1 navigates to display TestB, thus A.DLL needs to reference B.DLL so
the form will show. TestB navigates to display TestA2, thus B.DLL needs to
reference A.DLL so the form will show.

Will using an interface help in this situation? It doesn't seem that is
will but I might be missing something. Also, I want to keep the dlls
separate because they represent two different sets of business.
--
Thanks,
Leslie
Jul 21 '05 #1
1 1417
Yes, however it doesn't seem like you need to define your own additional
interface, you just need to use the Form base class that both DLLs
reference. To do this you can create either a constructor or a public
property on TestB that accepts a form reference. Then when you build
TestB (but before you display it) you set the property (or constructor
parameter) to an instance of TestA2. Then when you normally finish up
with TestB and display TestA2 you simply display whatever form was
passed into TestB.

You could extend this to a proprietary interface in a third DLL but it
really wouldn't change things much (other than to make sure any extra
properties that you might need to set from TestA and TestB are available
to each.

Have A Better One!

John M Deal, MCP
Necessity Software

Leslie wrote:
I have 2 dlls and they reference each other, thus causing the circular
dependence error. I have read about other cases and people say use
Interfaces to solve the problem with the shared methods. My case is getting
the error, not because methods need shared, but because forms need shared.
Example:
A.DLL has form TestA1, TestA2
B.DLL has form TestB

TestA1 navigates to display TestB, thus A.DLL needs to reference B.DLL so
the form will show. TestB navigates to display TestA2, thus B.DLL needs to
reference A.DLL so the form will show.

Will using an interface help in this situation? It doesn't seem that is
will but I might be missing something. Also, I want to keep the dlls
separate because they represent two different sets of business.

Jul 21 '05 #2

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

Similar topics

1
by: Henry Miller | last post by:
I have the following code (much simplified for this post). Note that SessionKey uses DataAccess, and DataAccess requires SessionKey in it's constructor. Public Class SessionKey Public...
2
by: ernesto basc?n pantoja | last post by:
Hi everybody: I'm implementing a general C++ framework and I have a basic question about circular dependencies: I am creating a base class Object, my Object class has a method defined as:...
16
by: Kiuhnm | last post by:
Is there an elegant way to deal with semi-circular definitions? Semi-circular definition: A { B }; B { *A }; Circular reference: A { *B }; B { *A }; The problems arise when there are more...
2
by: Earth Worm Jim | last post by:
I have been able to get simple circular references to be serialized in xml by using the ImportTypeMapping method on the SoapReflectionImporter class. But I am unable to serialise circular...
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)...
1
by: Leslie | last post by:
I have 2 dlls and they reference each other, thus causing the circular dependence error. I have read about other cases and people say use Interfaces to solve the problem with the shared methods. ...
7
by: barias | last post by:
Although circular dependencies are something developers should normally avoid, unfortunately they are very easy to create accidentally between classes in a VS project (i.e. circular compile-time...
3
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi I Have a solution with about 50 projects and each project have References to 1 to n of the projects in the solution. I try go to a project and try to add a reference to another project and I...
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
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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...

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.