![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Problem with circular references Hi newsgroup I have a little problem in designing my assemblies. Following situation: 1. I have 3 Assemblies: Assembly_A, Assembly_B and Assembly_C 2. Assembly_A has a Collection of Assembly_C 3. Assembly_B has as Collection of Assembly_C 4. Assembly_C has a Object of Assembly_A and another one of Assembly_B So that's the situation and the situation must be like this (relationally) because Assembly_A and Assembly_B represent contractors and Assembly_C represents the contract. A contract is made between A and B. Both contractors can have n contracts. A contract has one A and one B. When trying to build this solution with team build the build process stops in case of circular references. It is logical, because A cannot be build until C is build and C cannot be build until A is build. Now my question. Is there a desing that don't destry the logic of the depencies between the assemblies but don't result in build errors. If not, what kind of design should I use for cases like this? Thanks for every suggestions and help! Best regards D.H. Lee |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Problem with circular references If possible, commonly used objects should be pushed into common assemblies. So if what C uses in A doesn't have to be in A but could be in MyCommonStuff.dll (that knows nothing about A, B or C) then so much the better. Look seriously at whether or not you can achieve this. But if that's not possible then a couple of general comments : 1) use interfaces. If A needs B and B needs C and C needs A, then change it so that C knows absolutely nothing about A but uses an interface (defined in MyCommonStuff.dll) that A supports. 2) dynamic loading and object creation You can write C so that at run time it gets passed a few strings that tell it you need type "MyNameSpace.MyType" and its in assembly "MyDll_C.dll" The type supports an interface that C knows about and hey presto it works. A circular reference definitely means your design needs changing. HTH, Adam. "don H. Lee" <nospam@xxxxxx> wrote in message news:O5TTJ3icJHA.1532@xxxxxx Quote: > Hi newsgroup > > I have a little problem in designing my assemblies. > > Following situation: > > 1. I have 3 Assemblies: Assembly_A, Assembly_B and Assembly_C > 2. Assembly_A has a Collection of Assembly_C > 3. Assembly_B has as Collection of Assembly_C > 4. Assembly_C has a Object of Assembly_A and another one of Assembly_B > > So that's the situation and the situation must be like this (relationally) > because Assembly_A and Assembly_B represent contractors and Assembly_C > represents the contract. A contract is made between A and B. > > Both contractors can have n contracts. A contract has one A and one B. > > When trying to build this solution with team build the build process stops > in case of circular references. > It is logical, because A cannot be build until C is build and C cannot be > build until A is build. > > Now my question. Is there a desing that don't destry the logic of the > depencies between the assemblies but don't result in build errors. > > If not, what kind of design should I use for cases like this? > > Thanks for every suggestions and help! > > Best regards > > D.H. Lee > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Problem with circular references On Fri, 9 Jan 2009 08:40:03 +0100, "don H. Lee" <nospam@xxxxxx> wrote: Quote: >Hi newsgroup > >I have a little problem in designing my assemblies. > >Following situation: > >1. I have 3 Assemblies: Assembly_A, Assembly_B and Assembly_C >2. Assembly_A has a Collection of Assembly_C >3. Assembly_B has as Collection of Assembly_C >4. Assembly_C has a Object of Assembly_A and another one of Assembly_B > >So that's the situation and the situation must be like this (relationally) >because Assembly_A and Assembly_B represent contractors and Assembly_C >represents the contract. A contract is made between A and B. > >Both contractors can have n contracts. A contract has one A and one B. > >When trying to build this solution with team build the build process stops >in case of circular references. >It is logical, because A cannot be build until C is build and C cannot be >build until A is build. > >Now my question. Is there a desing that don't destry the logic of the >depencies between the assemblies but don't result in build errors. > >If not, what kind of design should I use for cases like this? > >Thanks for every suggestions and help! > >Best regards > >D.H. Lee A and B would implement that Interface, which would be defined in a fourth assembly that does not reference any of the others. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Project References. | .NET General | |||
| references an object name with a variable | PowerShell | |||
| Best references for learning C# for PowerShell? | PowerShell | |||