Cyclic dependencies - yet again?

I would try to pull the offending types out into a third 'common' assembly that the two 'parent' assemblies reference.

I would try to pull the offending types out into a third 'common' assembly that the two 'parent' assemblies reference. I would question however why you need multiple assemblies in the first place, however, when they both depend on each other. Assemblies are units of deployment, and can be versioned separately from each other.

If you don't need this functionality, I would just package everything into a single assembly and be done with it. This has the added bonuses of speeding up the build and simplifying deployment. Please do try to add more context to your question - maybe there are some details we can help with if we know exactly what it is you're trying to do.

Edit re your additions: To specifically answer your question regarding whether or not multiple assemblies is the way to go, consider this: I once worked on a codebase like this with Visual Studio 2008, where there were about 20 separate project files open in the solution at once. These 20 projects were all supporting DLLs for a single main EXE. These projects were not shared with other products, nor were there strange versioning requirements.

Working with this solution was a nightmare. It took literally 5 minutes for Visual Studio to compile the solution. Compiling in the command line with MSBuild took 2 minutes.

This made making incremental changes an exercise in frustration and pain. Since all of the projects were used in the making of the main executable, none of them could be unloaded to speed up the compile, and there was an executive mandate against breaking projects out into separate solutions. If you end up with a single solution like this, trust me when I say that you and your teammates will revolt one day... My recommendation would be to break out assemblies into their own solutions, grouping together any assemblies that are likely to be changed together; then create a custom build task that copies the final assembly into a common folder from with all the other assemblies can take references.

Erik, thank you for your comment – Martin Haluza Jan 21 '10 at 10:58 No problem - I hope it helps. =) – Erik Forbes Jan 21 '10 at 14:26.

I agree with one commenter that we probably need more information. Why do you have 2 assemblies? Is there a reason everything's not in one assembly?

How are these assemblies connected? Just via reference or are there WCF, etc components involved? We've given you the simplest answers, but maybe there's more to it than we can tell by your brief description.

Often you have classes that do too much. You may need to decompose some classes to find common stuff. – S.

Lott Jan 12 '10 at 19:42.

One way to avoid it would be using a proxy / business structure. AssemblyA. Proxy - contains two classes: one interface (let's call it IServices), and another class responsible for calling AssemblyA.

Business methods. AssemblyA. Business - contains one class, which implements the methods declared on IServices.AssemblyB.

Proxy - analogue to AssemblyA. Proxy AssemblyB. Business - analogue to AssemblyA.

Business This way, each Proxy component would reference only the business logic they're supposed to. AssemblyA. Proxy would have a reference to AssemblyA.

Business; AssemblyB. Proxy would have a reference to AssemblyB.Business.AssemblyA. Business would reference AssemblyB.

Proxy, and so on. Don't know if it it's clear but hope it helps.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions