Table of Contents

Class Model

Namespace
C4.Net
Assembly
C4.Net.Core.dll

A software architecture model.

[DataContract]
public sealed class Model
Inheritance
Model
Inherited Members

Fields

IdGenerator

Generates unique string identifiers for elements and relationships added to the model.

public IdGenerator IdGenerator

Field Value

IdGenerator

ImpliedRelationshipsStrategy

Controls whether additional implied relationships are created when static structure relationships are added.

public IImpliedRelationshipsStrategy ImpliedRelationshipsStrategy

Field Value

IImpliedRelationshipsStrategy

Properties

DeploymentNodes

The top-level deployment nodes defined in the model.

[DataMember(Name = "deploymentNodes", EmitDefaultValue = false)]
public ISet<DeploymentNode> DeploymentNodes { get; }

Property Value

ISet<DeploymentNode>

Enterprise

The enterprise boundary associated with this model, when one is defined.

[DataMember(Name = "enterprise", EmitDefaultValue = false)]
public Enterprise Enterprise { get; set; }

Property Value

Enterprise

People

The people defined in the model.

[DataMember(Name = "people", EmitDefaultValue = false)]
public ISet<Person> People { get; }

Property Value

ISet<Person>

Relationships

All relationships currently registered in the model.

public ICollection<Relationship> Relationships { get; }

Property Value

ICollection<Relationship>

SoftwareSystems

The software systems defined in the model.

[DataMember(Name = "softwareSystems", EmitDefaultValue = false)]
public ISet<SoftwareSystem> SoftwareSystems { get; }

Property Value

ISet<SoftwareSystem>

Methods

AddDeploymentNode(string)

Adds a top-level deployment node in the default deployment environment.

public DeploymentNode AddDeploymentNode(string name)

Parameters

name string

The deployment node name.

Returns

DeploymentNode

The created deployment node.

AddDeploymentNode(string, string, string)

Adds a top-level deployment node in the default deployment environment.

public DeploymentNode AddDeploymentNode(string name, string description, string technology)

Parameters

name string

The deployment node name.

description string

A short description of the deployment node.

technology string

The technology or product represented by the deployment node.

Returns

DeploymentNode

The created deployment node.

AddDeploymentNode(string, string, string, int)

Adds a top-level deployment node with an explicit instance count in the default environment.

public DeploymentNode AddDeploymentNode(string name, string description, string technology, int instances)

Parameters

name string

The deployment node name.

description string

A short description of the deployment node.

technology string

The technology or product represented by the deployment node.

instances int

The number of identical deployment node instances.

Returns

DeploymentNode

The created deployment node.

AddDeploymentNode(string, string, string, int, Dictionary<string, string>)

Adds a top-level deployment node with custom properties in the default environment.

public DeploymentNode AddDeploymentNode(string name, string description, string technology, int instances, Dictionary<string, string> properties)

Parameters

name string

The deployment node name.

description string

A short description of the deployment node.

technology string

The technology or product represented by the deployment node.

instances int

The number of identical deployment node instances.

properties Dictionary<string, string>

Custom name-value properties for the deployment node.

Returns

DeploymentNode

The created deployment node.

AddDeploymentNode(string, string, string, string)

Adds a top-level deployment node in the specified deployment environment.

public DeploymentNode AddDeploymentNode(string environment, string name, string description, string technology)

Parameters

environment string

The deployment environment name.

name string

The deployment node name.

description string

A short description of the deployment node.

technology string

The technology or product represented by the deployment node.

Returns

DeploymentNode

The created deployment node.

AddDeploymentNode(string, string, string, string, int)

Adds a top-level deployment node with an explicit instance count in the specified environment.

public DeploymentNode AddDeploymentNode(string environment, string name, string description, string technology, int instances)

Parameters

environment string

The deployment environment name.

name string

The deployment node name.

description string

A short description of the deployment node.

technology string

The technology or product represented by the deployment node.

instances int

The number of identical deployment node instances.

Returns

DeploymentNode

The created deployment node.

AddDeploymentNode(string, string, string, string, int, Dictionary<string, string>)

Adds a top-level deployment node with custom properties in the specified environment.

public DeploymentNode AddDeploymentNode(string environment, string name, string description, string technology, int instances, Dictionary<string, string> properties)

Parameters

environment string

The deployment environment name.

name string

The deployment node name.

description string

A short description of the deployment node.

technology string

The technology or product represented by the deployment node.

instances int

The number of identical deployment node instances.

properties Dictionary<string, string>

Custom name-value properties for the deployment node.

Returns

DeploymentNode

The created deployment node.

AddImplicitRelationships()

Propagates all relationships from children to their parents. For example, if you have two components (AAA and BBB) in different software systems that have a relationship, calling this method will add the following additional implied relationships to the model: AAA->BB AAA-->B AA->BBB AA->BB AA->B A->BBB A->BB A->B.

public ISet<Relationship> AddImplicitRelationships()

Returns

ISet<Relationship>

a set of all implicit relationships

AddPerson(Location, string, string)

Creates a person (location is unspecified) and adds it to the model (unless one exisrs with the same name already.

public Person AddPerson(Location location, string name, string description)

Parameters

location Location

the location of the person (e.g. internal, external, etc)

name string

the name of the person (e.g. "Admin User" or "Bob the Business User")

description string

a short description of the person

Returns

Person

the Person instance created and added to the model (or null)

AddPerson(string)

Creates a person (location is unspecified) and adds it to the model (unless one exists with the same name already.

public Person AddPerson(string name)

Parameters

name string

the name of the person (e.g. "Admin User" or "Bob the Business User")

Returns

Person

the Person instance created and added to the model (or null)

AddPerson(string, string)

Creates a person (location is unspecified) and adds it to the model (unless one exists with the same name already.

public Person AddPerson(string name, string description)

Parameters

name string

the name of the person (e.g. "Admin User" or "Bob the Business User")

description string

a short description of the person

Returns

Person

the Person instance created and added to the model (or null)

AddSoftwareSystem(Location, string, string)

Creates a software system (location is unspecified) and adds it to the model (unless one exists with the same name already).

public SoftwareSystem AddSoftwareSystem(Location location, string name, string description)

Parameters

location Location

The location of the software system (e.g. internal, external, etc)

name string

The name of the software system

description string

A short description of the software system.

Returns

SoftwareSystem

the SoftwareSystem instance created and added to the model (or null)

AddSoftwareSystem(string)

Creates a software system (location is unspecified) and adds it to the model (unless one exists with the same name already).

public SoftwareSystem AddSoftwareSystem(string name)

Parameters

name string

The name of the software system.

Returns

SoftwareSystem

the SoftwareSystem instance created and added to the model (or null)

AddSoftwareSystem(string, string)

Creates a software system (location is unspecified) and adds it to the model (unless one exists with the same name already).

public SoftwareSystem AddSoftwareSystem(string name, string description)

Parameters

name string

The name of the software system.

description string

A short description of the software system.

Returns

SoftwareSystem

the SoftwareSystem instance created and added to the model (or null)

Contains(Element)

Determines whether the model already contains the specified element instance.

public bool Contains(Element element)

Parameters

element Element

The element to look for.

Returns

bool

true when the element is registered in the model; otherwise, false.

GetDeploymentNodeWithName(string, string)

Gets the DeploymentNode with the specified name.

public DeploymentNode GetDeploymentNodeWithName(string name, string environment)

Parameters

name string

the name of the deployment node

environment string

the name of the deployment environment

Returns

DeploymentNode

the DeploymentNode instance with the specified name (or null if it doesn't exist)

GetElement(string)

Gets an element by identifier.

public Element GetElement(string id)

Parameters

id string

The element identifier.

Returns

Element

The matching element.

GetElementWithCanonicalName(string)

Gets the element with the specified canonical name.

public Element GetElementWithCanonicalName(string canonicalName)

Parameters

canonicalName string

the canonical name (e.g. /SoftwareSystem/Container)

Returns

Element

the Element with the given canonical name, or null if one doesn't exist

GetElements()

Returns all elements currently registered in the model.

public IEnumerable<Element> GetElements()

Returns

IEnumerable<Element>

An enumeration of model elements.

GetPersonWithName(string)

Gets the Person instance with the specified name.

public Person GetPersonWithName(string name)

Parameters

name string

The person name to search for.

Returns

Person

A Person instance, or null if one doesn't exist.

GetRelationship(string)

Gets a relationship by identifier.

public Relationship GetRelationship(string id)

Parameters

id string

The relationship identifier.

Returns

Relationship

The matching relationship.

GetSoftwareSystemWithId(string)

Gets the software system with the specified identifier.

public SoftwareSystem GetSoftwareSystemWithId(string id)

Parameters

id string

The identifier of the software system to find.

Returns

SoftwareSystem

The matching software system, or null if one does not exist.

GetSoftwareSystemWithName(string)

Gets the SoftwareSystem instance with the specified name.

public SoftwareSystem GetSoftwareSystemWithName(string name)

Parameters

name string

The software system name to search for.

Returns

SoftwareSystem

A SoftwareSystem instance, or null if one doesn't exist.

ModifyRelationship(Relationship, string, string)

Provides a way for the description and technology to be modified on an existing relationship.

public void ModifyRelationship(Relationship relationship, string description, string technology)

Parameters

relationship Relationship

a Relationship instance

description string

the new description

technology string

the new technology