Skip to content

Viewpoints

etcion.metamodel.viewpoints

Viewpoint mechanism for the ArchiMate 3.2 metamodel.

Reference: ADR-029, EPIC-017; ArchiMate 3.2 Specification, Section 13.

Viewpoint

Bases: BaseModel

A viewpoint defines a perspective on a model.

Viewpoints are NOT Concepts — they are metamodel metadata constraining which concept types may appear in a View.

View

Bases: BaseModel

A view is a projection of a Model through a Viewpoint.

Concepts are added via :meth:add, which enforces a type gate (concept type must be permitted by the viewpoint) and a membership gate (concept must exist in the underlying model).

add(concept)

Add a concept to this view.

:raises etcion.exceptions.ValidationError: if the concept's type is not permitted by the governing viewpoint, or if the concept is not present in the underlying model.

Source code in src/etcion/metamodel/viewpoints.py
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
def add(self, concept: Concept) -> None:
    """Add a concept to this view.

    :raises etcion.exceptions.ValidationError: if the concept's type
        is not permitted by the governing viewpoint, or if the concept
        is not present in the underlying model.
    """
    # Type gate
    if not any(
        issubclass(type(concept), t) for t in self.governing_viewpoint.permitted_concept_types
    ):
        raise ValidationError(
            f"{type(concept).__name__} is not permitted by viewpoint "
            f"'{self.governing_viewpoint.name}'"
        )
    # Membership gate
    if concept.id not in self.underlying_model._concepts:
        raise ValidationError(f"Concept '{concept.id}' is not present in the underlying model")
    self.concepts.append(concept)

Concern

Bases: BaseModel

Links stakeholders to viewpoints.

Navigation: Stakeholder -> Concern -> Viewpoint -> View.

etcion.metamodel.viewpoint_catalogue

Predefined Viewpoint Catalogue for the ArchiMate 3.2 metamodel.

Contains the 28 standard viewpoints enumerated in the XSD ViewpointsEnum (archimate3_View.xsd, lines 273-312), assembled into a lazy caching registry.

Reference: ADR-035, FEAT-22.1; ArchiMate 3.2 Specification, Appendix C.

ViewpointCatalogue(builders)

Bases: Mapping[str, Viewpoint]

Lazy, caching registry of the 28 standard ArchiMate 3.2 viewpoints.

Keys are the exact XSD ViewpointsEnum string tokens (e.g. "Organization", "Application Cooperation"). Viewpoint instances are constructed on first access and memoised for the lifetime of the catalogue.

Source code in src/etcion/metamodel/viewpoint_catalogue.py
117
118
119
def __init__(self, builders: dict[str, Callable[[], Viewpoint]]) -> None:
    self._builders = builders
    self._cache: dict[str, Viewpoint] = {}