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

Problem in adding circular references

Gos
Hi,

It is known that .NET does not allow us to add circular references. Is
there a way to workaround this problem by late-binding the objects at
run time? Will this create any other problems?

One solution to the problem is to re-architect the solution. But, I
dont want to do this as there are many modules in the project which
are already developed and nearing the release.

Any help would be appreciated.

Thanks
Gos
Nov 20 '05 #1
5 6833
late binding creates performance and maintanence problems...and still holds
a reference to whatever you are trying to reference circularly. .net will
handle the reference just as it would in early binding.

i can't remember the exact example i saw here of creating/managing circular
references...either someone will post it again or advise you otherwise.

hth,

steve
"Gos" <er***********@yahoo.com> wrote in message
news:a3**************************@posting.google.c om...
Hi,

It is known that .NET does not allow us to add circular references. Is
there a way to workaround this problem by late-binding the objects at
run time? Will this create any other problems?

One solution to the problem is to re-architect the solution. But, I
dont want to do this as there are many modules in the project which
are already developed and nearing the release.

Any help would be appreciated.

Thanks
Gos

Nov 20 '05 #2
Gos,
..NET fully supports circular references between objects!

Are you referring to circular references between projects?

What I would suggest is a Separated Interface Pattern.
http://www.martinfowler.com/eaaCatal...Interface.html

When you implement this pattern you can dynamically load one of the classes
if you want giving you the a benefit of late-binding. However! because of
the Separated Interface you will have the benefit of early binding also.

If you search the microsoft.public.dotnet.* newsgroups at groups.google.com
for Separated Interface Pattern you should find a number of references and
other tidbits on the above pattern.

Hope this helps
Jay

"Gos" <er***********@yahoo.com> wrote in message
news:a3**************************@posting.google.c om...
Hi,

It is known that .NET does not allow us to add circular references. Is
there a way to workaround this problem by late-binding the objects at
run time? Will this create any other problems?

One solution to the problem is to re-architect the solution. But, I
dont want to do this as there are many modules in the project which
are already developed and nearing the release.

Any help would be appreciated.

Thanks
Gos

Nov 20 '05 #3
"Gos" <er***********@yahoo.com> schrieb
It is known that .NET does not allow us to add circular references.
I'm almost sure that this is not true. In opposite to earlier times using
circular references with COM objects, the garbage collector does recognize
and collect "lost" objects that are no longer referenced anymore.
Is there a way to workaround this problem by late-binding the objects
at run time? Will this create any other problems?

One solution to the problem is to re-architect the solution. But,
I dont want to do this as there are many modules in the project
which are already developed and nearing the release.

--
Armin

Nov 20 '05 #4
Gos
I am talking about circular reference between projects. I am sorry if
I haven't made it clear. I know that .NET supports circular reference
with objects but not projects. I am also not sure whether I will be
able to have interfaces in my program because it is a service based
architecture and the forms are 'Friend' members of a DLL. I have to
access the outside world through my service class. It is something
like MainForm->ServiceClasses(DLL entry point)->Classes &
Forms(contained in DLL).

Project A(serviceclass) has reference to Project B(serviceclass)
already. I want access to Project A from Project B now. I am trying to
create a new object of type 'System.Object' and assign an instance of
A to this object in MainForm and pass the new object to Project B
(instead of passing a type which is of Type A, I am passing an
'System.Object' type to B and call the method in A through that object
using late-binding.) But, I haven't yet tested it. Please let me know
if you have any other suggestions. I will post my solution if it
works.

Thanks
Nov 20 '05 #5
Gos
I have got rid that problem by event handling mechanism. Though it is
not a very good solution, the team does not want to re-architect the
project.

Thanks for your help.

Gos
Nov 20 '05 #6

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

Similar topics

1
by: Covad | last post by:
Hi all, For some reason my change() function is only called when the page loads. I'd much rather it gets called when the select changes. Here's the code: window.onload = init; function...
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...
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...
3
by: Solution Seeker | last post by:
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...
12
by: Joel Byrd | last post by:
I am making an AJAX call when any one of a number of inputs in a form (search criteria) are clicked, checked, changed, etc. When the user clicks, checks, whatever, I am trying to display a...
2
by: Lapu-Lapu | last post by:
I have authored a web service using ASP 2.0. The web services return objects that use generics and that also contain circular references. Programmatically, everything works well, as long as you...
14
by: Cylix | last post by:
I have a array to store some student information, eg var s = new Array('2006001', 'Apple Joker', '5B'); normally, We get the data using s, s,s ... How can I define them more readable like s, s,...
5
by: Madhur | last post by:
Hello If I define two classes in the same cs file. And in each class, I define the object of other class as a member. Can anyone explain me how .NET or its compiler will resolve this kind of...
2
by: Dansk | last post by:
Hi all, I am currently writing some code that explores assemblies dependencies. I start loading the first assembly with Assmebly.LoadFrom which gives me an Assembly instance. Then, I...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.