Re: Circular references ?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Dave S (dave_xxx70_at_hotmail.com)
Date: 04/07/04


Date: Wed, 07 Apr 2004 22:09:35 GMT

Erik,

Thanks for this, I just wanted to confirm that it's not possible to do it
with just 2 projects.
I tried moving my object into another project (so it's sort of an interface
project) and then each of the other projects can reference that project
without causing the circular reference problem.
I just thought it was a bit messy when in Java you could easily do this
without a middleman package containing the object you want to pass between
the classes.
At least I know that it wasn't something I'd missed out when declaring the 2
projects initially.
Will have to remember this one in future (I've been struggling with this all
afternoon)

Dave

"Erik Frey" <eriksjunk@hotmail.com> wrote in message
news:uCVltrOHEHA.3556@TK2MSFTNGP10.phx.gbl...
> "Dave S" <dave_xxx70@hotmail.com> wrote in message
> news:ac629e82aab3c366fe2c0c20e78b5eee@news.teranews.com...
> > Anyone know how to get round the problem of circular references in
VB.NET
> > (sorry I'm a .NET newbie).
> > I create one project which has 2 classes in it, MyHandler and MyObject.
> > MyHandler just needs to call another class in a different project and
pass
> a
> > parameter of type MyObject to it.
> > So the class in the different project needs to import the first project
> > namespace so it know what MyObject is.
> > The MyHandler class needs to import the second project namespace so it
can
> > call the class in the second project.
>
> Typically this is adressed by creating a third project that contains your
> business types in it.
>
> Then have your other two projects refer to this new project, to have
access
> to the common type (so in your case, put MyObject in the third project).
>
> Also, keep in mind that even if you have three projects in a solution, you
> still have to add the project references manually (right click on
> References - > Add References -> Projects tab)
>
> Erik
>
>



Relevant Pages

  • Re: event problem
    ... // when event is triggered, 'this' refers to myDomElement, ... // and not myObject. ... It would result in the DOM element holding a reference to the myObject ... circular reference between a DOM object and a javascript object. ...
    (microsoft.public.scripting.jscript)
  • Re: event problem
    ... // when event is triggered, 'this' refers to myDomElement, ... // and not myObject. ... It would result in the DOM element holding a reference to the myObject ... circular reference between a DOM object and a javascript object. ...
    (microsoft.public.scripting.jscript)
  • Re: event problem
    ... // when event is triggered, 'this' refers to myDomElement, ... // and not myObject. ... circular reference between a DOM object and a javascript object. ...
    (microsoft.public.scripting.jscript)