473,388 Members | 1,557 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,388 software developers and data experts.

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 1415
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.