Results 1 to 3 of 3

Thread: How to work around circular dependencies

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2003
    Posts
    2

    Question How to work around circular dependencies

    Hi all,

    I'm working on a fairly huge project for a compagny; (not that i'm part of that compagny, I'm just slave labouring for free as a school trainee ).

    Because of it's huge nature, it's being considered placing the programming in several project under one solution. BUT, the projects need to work toghether. Access each others forms, etc.

    So, you compile the projects as class libraries, reference to each other.

    This works great, as long as it's in one direction.

    So assume you have 3 projects. Project A is a startup project compiled as an executable.

    Project B & C are both class libraries.

    Project A has a reference to both B and C, so it can open their forms. Project B has a reference to C, so that can open C's forms as well..... BUT Project C should be able to access the forms of Project B......................

    But that's impossible, because then you have a circular dependency...

    How do you folk deal with this? Is there are way to work around this problem? (except putting it all ine one project)


    Thankies

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    If they all have to call each others stuff then I would leave them as one project. Usually you seperate into tiers or layers based on an objects role (i.e. Data, Presentation, Business) which still has all the forms in one layer or tier.

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Put classes they have in common into its own library.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

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