In the first part How to split monolith solution - part 1: common myths I wrote about common myths. In this post I will try to find the "seams" to cut, using the Visual Studio and the ReSharper. Let's go!

Assumptions

Big solution :) Time :D Will for change

I will use .NET solution and tools because I know them the best.

Visual Studio ReSharper from JetBrains (https://www.jetbrains.com/resharper/) - be careful it is addictive

My solution

Overview:

67 projects 36 projects on root 2 sub-folders with projects 19 projects with tests

In the Visual Studio, it looks like below:

To start working we need to visualize dependencies. And in this part, ReSharper save my day.

With ReSharper, you can explore project dependencies in your solution using a visual representation of the solution architecture. At any time, you can open the Architecture View (ReSharper | Architecture | Show Project Dependency Diagram) and explore project dependencies without compiling anything.

If you know other tools, which can do above, please let me know in comments.

Anyway. After simple click on ReSharper->Architecture->Show Project Dependency Diagram below image showed. (Yellow and green rectangle I added myself using paint):

What did I notice?

There are 3 projects without a reference to anything else . It is a yellow group on the bottom-right. There are more groups like this, but on the overview, I don't see them clearly. My solution folders marked with black background rectangles. The left-hand side is tests . Green rectangle marks a big separated part. There isn't anything with reference to this part.

The good thing is that I have a folder so I can use collapsed graph in smaller groups. Just click:

.

In my case it looks like following:

After collapse I noticed more:

1. I have only one arrow down - arrow shows dependency between projects

2. I have more project without a reference.

3. I can ease create compilation tiers, there are 7 layers on above picture.

The most interesting point is 2. Why do I have unrelated projects? I see following possibilities:

IoC;

tools without direct dependency like MSBuild tasks, file converter, UI test stuff, DB helpers, etc.;

more complex infrastructure - above solution is not the only one in the project;

something more? If yes please let me know :)

As you think about first 2 groups we can easily move out. In my case, it is 9 projects from 67. It is ~13% of all projects in the solution. If I exclude tests projects it is ~18%. So I just make my solution a bit smaller.

Sum up

After quite simple above steps I noticed that:

I have parts that can be easily separated Most my references are one-way. From bottom to up. I can easily create compilation tiers. Folders in big solution are good in the overview.

What's coming next?

What is a compilation tier, because I didn't explain it at all and guys in comments ask for it :) - it is already available: How to split monolith solution - part 3 - compilation tiers Dependency management, for compilation tiers. Split or remove circular dependencies in grouped projects



Follow @ptrstpp950