What problems are easy to spot in the dependency graph?
The biggest problem you can find is by far the Dependency Loops. The NDepend tool offers an interactive dependency matrix and dependency graph to help you identify dependent keels . Disclaimer: I am one of the developers of this tool
Note that the dependency matrix is ββmuch more tailored than the graph for defining loops. Because the loop avoids the triangular matrix.
Other ranges of concerns relate to your application structure: for example, is it okay for the UI to use the DB directly? or much worse, does DB depend on the UI?
You can write code rules above LINQ queries (CQLinq) to check for forbidden dependencies. The following code rule verifies that UI types should not directly use DB types:
// <Name>UI layer shouldn't use directly DB types</Name>
warnif count > 0
// UI layer is made of types in namespaces using a UI framework
let uiTypes = Application.Namespaces.UsingAny(Assemblies.WithNameIn("PresentationFramework", "System.Windows", "System.Windows.Forms", "System.Web")).ChildTypes()
// You can easily customize this line to define what are DB types.
let dbTypes = ThirdParty.Assemblies.WithNameIn("System.Data", "EntityFramework", "NHibernate").ChildTypes()
// Ideally even DataSet and associated, usage should be forbidden from UI layer:
// http://stackoverflow.com/questions/1708690/is-list-better-than-dataset-for-ui-layer-in-asp-net
.Except(ThirdParty.Types.WithNameIn("DataSet", "DataTable", "DataRow"))
from uiType in uiTypes.UsingAny(dbTypes)
let dbTypesUsed = dbTypes.Intersect(uiType.TypesUsed)
select new { uiType, dbTypesUsed }
source to share
A presenter at the NFJS conference showed us some dependency graphs ... One smell he pointed out was looking for things with relationships to different functional parts of your codebase. They are likely to destroy encapsulation.
Also, I would look at the overall difficulty of each section. Individuals with all lines are suspects.
source to share