Thumb rules for adding links between C # projects?

I have a question about links between projects in a solution. Most of my previous applications just had one or two projects in solution, but this time I want to split the application further.

Now I am launching a new solution in Visual Studio 2008 and have created several basic projects to separate the separate parts of my application.

But for the time being, I'm just creating various projects on a whim and creating links between them when I need it. Sometimes I find myself in a situation where two projects must refer to each other, but this is not allowed, as this will cause a cyclical dependency.

Are there any rules / tips / templates that I should consider when creating different projects and combining them?

Should I start on the inside and go out? If the "core" projects reflect all external projects or, perhaps, come from outside, and where do independent projects refer to the "core"? Or the third option, when I have a business in two projects, and both of them refer to the third project?

+3
source share
3 answers

Indeed, you cannot have circular references, but honestly, what would be useful for dividing a solution into a small project if you had interdependencies between them?

, Visual Studio, . , - . "" , . , , . , " " .. , .

, , , , .

, , , , .

+9

, , , "" "" .

, "", "", , , . ...

  • # "internal". , .

  • JIT , , . ( ).

, .

+4

Winforms. . .

Example.Entities. -

Example.Dal. ( ). , -, .

Example.Gui. Winforms GUI "" . . Example.Gui .

Example.Test. .

Entities, - -.

Gui Dal ( ). , Dal, . , , , .

Entities - dll Assembly, . .NET SOAP.

The GUI layer should treat DAL internals as a black box. Your main application should not care how business objects are loaded or saved. But you should use your test project to thoroughly test your DAL.

+2
source

All Articles