Reputation: 1594
suppose build time for a project is taking a long time. So, I want to plan a refactoring project to make some parts of it as separate assembly to avoid recompilation. Now, there are many things that I could try refactoring, so it would be nice to identify those modules that would give me the most build time reduction bang for the effort.
So how do I do that? Can I make predictions based on crude human-countable metrics like number of lines or methods? Or can I use some sort of profiler for compiler that would measure compiler's speed at handling various modules or even make oracular pronouncements/recommendations about which modules are most asking for refactoring?
Upvotes: 0
Views: 65
Reputation: 161821
I wouldn't worry so much about build time, per se. If project build times are taking so long, and if reducing the size of individual assemblies would help, then it probably means you have too many unrelated classes in a single assembly.
I would first refactor your classes to ensure they have a Single Responsibility. I would also make sure that your classes and class members use the minimum access possible - don't make all of your classes public
and don't make all of your members public
or protected
.
Next, try to figure out which public classes are related. If you have named them appropriately, then you should be able to do this based on the names of the classes.
Consider the possibility of one assembly per set of related classes. Hopefully each such assembly will contain classes that mostly refer to each other. There will be some dependencies on other assemblies. You'll have to get clear on which of the new assemblies really needs access to which others.
Using ReSharper (or another such tool) can make this process practical.
Upvotes: 1