Quantcast
Channel: NsDepCop Wiki Rss Feed
Viewing all articles
Browse latest Browse all 60

Updated Wiki: Example

$
0
0
This project has been moved to GitHub.
For the latest documentation please follow this link:
https://github.com/realvizu/NsDepCop

Example

This example is taken from the NsDepCop tool itself. A package diagram depicts the namespaces and their dependencies and two dependency config files show how those dependencies are represented as rules.

Consider the following package diagram.
  • NsDepCop.MsBuildTask and NsDepCop.Core are two assemblies (and C# projects) and they both have a dependency config file (see below).
  • The colored numbers help to identify which dependency is described by which rule element.
  • The star symbol on some arrow ends means that the whole package subtree is included in the rule.
  • The VisibleMembers elements in one of the config files define the types that are exposed to other namespaces.
NsDepCop_Package_Dependencies_600w.jpg

nsdepcop.config for NsDepCop.MsBuildTask
NsDepCop.MsBuildTask_Config_framed.jpg

nsdepcop.config for NsDepCop.Core
NsDepCop.Core_Config_framed.jpg

You can read the picture (and the corresponding rule config files) like this:
  • The NsDepCop.Core package is devided into Interface, Factory and Implementation packages.
    • Interface is not dependent on anything.
    • Implementation (and its sub-packages) can depend on Interface in order to realize it.
    • Implementation.NRefactory depends on the NRefactory libraries (ICSharpCode.NRefactory namespace and its children).
    • Implementation.Roslyn depends on the Roslyn libraries (Microsoft.CodeAnalysis namespace and its children).
    • Factory depends on both Interface and Implementation.
    • But Implementation exposes only some types: DependencyAnalyzer from the NRefactory and Roslyn packages and TypeDependencyValidator from the Common package.
  • NsDepCop.MsBuildTask implements the MsBuild-hosting of NsDepCop.
    • It uses the NsDepCop.Core package as a client, so it depends on Interface and Factory packages.
    • It can also depend on the MsBuild library (Microsoft.Build namespace and its children).


Viewing all articles
Browse latest Browse all 60

Trending Articles