Analyze and model your architecture

Make sure your app meets architectural requirements by using Visual Studio architecture and modeling tools to design and model your app.

  • Understand existing program code more easily by using Visual Studio to visualize the code's structure, behavior, and relationships.

  • Educate your team in the need for respecting architectural dependencies.

  • Create models at different levels of detail throughout the application lifecycle as part of your development process.

See Scenario: Change your design using visualization and modeling.

Article reference

Scenario Articles
Visualize code:

- See the code's organization and relationships by creating code maps. Visualize dependencies between assemblies, namespaces, classes, methods, and so on.
- See the class structure and members for a specific project by creating class diagrams from code.
- Find conflicts between your code and its design by creating dependency diagrams to validate code.
- Visualize code
- Working with Classes and Other Types (Class Designer)
- Video: Understand design from code with Visual Studio 2015 code maps
- Video: Validate your architecture dependencies in real time
Define the architecture:

- Define and enforce constraints on dependencies between the components of your code by creating dependency diagrams.
- Video: Validate architecture dependencies with Visual Studio (Channel 9)
Validate your system with the requirements and intended design:

- Validate code dependencies with dependency diagrams that describe the intended architecture and prevent changes that might conflict with the design.
- Video: Validate architecture dependencies with Visual Studio (Channel 9)
Customize models and diagrams:

- Create your own domain-specific languages.
- Modeling SDK for Visual Studio - Domain-Specific Languages
Generate text using T4 templates:

- Use text blocks and control logic inside templates to generate text-based files.
- T4 template build with MSBuild included in Visual Studio
- Code Generation and T4 Text Templates
Share models, diagrams, and code maps using Team Foundation version control:

- Put code maps, projects, and dependency diagrams under Team Foundation version control so you can share them.

To see which editions of Visual Studio support each feature, see Edition support for architecture and modeling tools

Types of models and typical uses

Code maps

Code maps help you see the organization and relationships in your code.

Typical uses:

  • Examine program code so you can better understand its structure and its dependencies, how to update it, and estimate the cost of proposed changes.

See:

Dependency diagrams

Dependency diagrams let you define the structure of an application as a set of layers or blocks with explicit dependencies. Live validation shows conflicts between dependencies in the code and dependencies described on a dependency diagram.

Typical uses:

  • Stabilize the structure of the application through numerous changes over its life.
  • Discover unintentional dependency conflicts before checking in changes to the code.

See:

Domain-specific language (DSL)

A DSL is a notation that you design for a specific purpose. In Visual Studio, it's usually graphical.

Typical uses:

  • Generate or configure parts of the application. Work is required to develop the notation and tools. The result can be a better fit to your domain than a UML customization.
  • For large projects or in product lines where the investment in developing the DSL and its tools is returned by its use in more than one project.

See:

See also