Table of Contents

Class Container

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

A container (e.g. an application or data store).

[DataContract]
public sealed class Container : StaticStructureElement, IEquatable<Container>
Inheritance
Container
Implements
Inherited Members

Properties

CanonicalName

Gets the canonical name for this container.

public override string CanonicalName { get; }

Property Value

string

Components

The set of components within this container.

[DataMember(Name = "components", EmitDefaultValue = false)]
public ISet<Component> Components { get; set; }

Property Value

ISet<Component>

Parent

The software system that owns this container.

public override Element Parent { get; set; }

Property Value

Element

SoftwareSystem

The software system that this container belongs to.

public SoftwareSystem SoftwareSystem { get; }

Property Value

SoftwareSystem

Technology

The technology associated with this container (e.g. Windows Service).

[DataMember(Name = "technology", EmitDefaultValue = false)]
public string Technology { get; set; }

Property Value

string

Methods

AddComponent(string)

Adds a component with the specified name (unless one exists with the same name already).

public Component AddComponent(string name)

Parameters

name string

the name of the component

Returns

Component

a Component instance

AddComponent(string, string)

Adds a component with the specified name and description (unless one exists with the same name already).

public Component AddComponent(string name, string description)

Parameters

name string

the name of the component

description string

a short description/list of responsibilities

Returns

Component

a Component instance

AddComponent(string, string, string)

Adds a component with the specified name, description and technology (unless one exists with the same name already).

public Component AddComponent(string name, string description, string technology)

Parameters

name string

the name of the component

description string

a short description/list of responsibilities

technology string

the technology choice

Returns

Component

a Component instance

AddComponent(string, string, string, string)

Adds a component whose primary implementation type is described by a fully qualified type name.

public Component AddComponent(string name, string type, string description, string technology)

Parameters

name string

The component name.

type string

The fully qualified implementation type name.

description string

A short description of the component responsibilities.

technology string

The implementation technology.

Returns

Component

The created component, or null if a component with the same name already exists.

AddComponent(string, Type, string, string)

Adds a component whose primary implementation type is described by a CLR Type.

public Component AddComponent(string name, Type type, string description, string technology)

Parameters

name string

The component name.

type Type

The CLR type that represents the component.

description string

A short description of the component responsibilities.

technology string

The implementation technology.

Returns

Component

The created component, or null if a component with the same name already exists.

Equals(Container)

Compares this container with another container by canonical identity.

public bool Equals(Container container)

Parameters

container Container

The container to compare with.

Returns

bool

true when both containers represent the same model element; otherwise, false.

GetComponentOfType(string)

Finds a component in this container by its primary implementation type.

public Component GetComponentOfType(string type)

Parameters

type string

The fully qualified type name to search for.

Returns

Component

The matching component, or null when no match exists.

GetComponentWithName(string)

Finds a component in this container by name.

public Component GetComponentWithName(string name)

Parameters

name string

The component name to search for.

Returns

Component

The matching component, or null when no match exists.

GetRequiredTags()

Returns the tags that are always applied to containers.

public override List<string> GetRequiredTags()

Returns

List<string>

The required container tags.