Results 1 to 3 of 3

Thread: [RESOLVED] Is this horrible practice?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    675

    Resolved [RESOLVED] Is this horrible practice?

    For reasons that are beyond my control, I have three Projects.

    Projects A and B reference project C.
    Project A references project B so that it can open a large form in project B.
    I now need to open that large form from project C, but VB won't allow me to add a reference from C to B because that would create a circular dependency.

    I found a way around it, though. I created a Timer in A, and when I opened C from A, I passed in that timer. When the user performs a certain action, I enable the Timer from A, and this causes C to open B for me.

    Are there dangers to this approach? It seems horribly hacky to me, but I would probably still do it.

    Thanks
    VB.Net 2008
    .Net Framework 2.0

    "Must you breathe? 'Cause I need heaven..."

  2. #2
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: Is this horrible practice?

    Yes, this is moderately horrible.
    First of all, if you can refactor this solution - do that. At least to the point where you can stop using Project B from project C.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    675

    Re: Is this horrible practice?

    OK, I figured out a better way. I think I can move the form from C to B.

    We just have this project full of common forms and subs that all other projects reference, so I started by putting this new form in there. But, I realized that only a few projects will ever actually need this, so I can put it somewhere where the projects that do need it are already referencing.
    VB.Net 2008
    .Net Framework 2.0

    "Must you breathe? 'Cause I need heaven..."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width