# Системная инженерия.
Архитектурное моделирование компьютерных систем ## Лекция 7-8 ### Архитектурное документирование. Решения. Представления.
Архитектурные стили Пенской А.В., 2025 --- ### Architecture. Architectural Specification
Architecture
is fundamental concepts or properties of a system in its environment embodied in its elements, relationships, and in the principles of its design and evolution [ISO 42010].
Architectural Specification
work product used to express an architecture.
 
---- ## Архитектурное документирование
Architecture serves as: 1. a means of education 2. a primary vehicle for communication among stakeholders 3. the basis for system analysis and construction В составе архитектурной документации: 1. Архитектурные представления 1. Архитектурные решения
Все подробности тут: 
--- ## Шаблон:
Архитектурное представление
Структура документа: 1. Наименование представления 1. Основное представление 1. Каталог элементов (~ архитектурный стиль) - Элементы и их свойства - Отношения и их свойства - Интерфейсы элементов - Поведение элементов 1. Диаграмма контекста 1. Инструкции по вариативности 1. Обоснование
Представление (View)
Представление системы с заданной точки зрения.

---- ### Наименование представления What you describe in the view. ### Основное представление The **primary presentation** shows the elements and relations of the view. The primary presentation should contain the information you wish to convey about the system. ---- ### Каталог элементов (Element Catalog) The **element catalog** details at least those elements depicted in the primary presentation. E.g., if a diagram shows elements A, B, and C, then the element catalog needs to explain what A, B, and C are and their purposes or the roles they play. Подразделы: - Элементы и их свойства - Отношения и их свойства - Интерфейсы элементов - Поведение элементов ---- #### Элементы и их свойства (Elements and properties) This section names each element in the view and lists their properties. Properties depend on the architectural style, e.g., a decomposition style might have a "responsibility" property — the module's role in the system. #### Отношения и их свойства (Relations and properties) Mostly, these relations are shown in the primary presentation. If not, or if the description requires additional details — this is the place to record them. #### Интерфейсы элементов (Element interfaces) This section documents element interfaces. #### Поведение элементов (Element behavior) Some elements have complex interactions with the environment. For purposes of understanding or analysis, they need to be documented. ---- ### Диаграмма контекста (Context Diagram) Shows how the system or portion of the system depicted in this view relates to its environment. ### Инструкции по вариативности
(Variability Guide) Shows how to exercise any variation points that are a part of the architecture shown in this view. ### Обоснование (Rationale) **Rationale** explains why the design reflected in the view came to be. The goal of this section is to explain why the design is as it is and to provide a convincing argument that it is sound. The use of a pattern or style in this view should be justified here. --- ## Шаблон:
Архитектурное решение
1. Наименование проблемы 1. Решение 1. `*` Статус: `pending` | `decided` | `approved` 1. `*` Группа 1. Предположения 1. Альтернативы 1. Аргументы 1. Последствия 1. `*` Связанные решения 1. Связанные требования 1. `*` Связанные артефакты 1. `*` Заметки
$\leftarrow$ Структура документа
Архитектурное решение
решение, ошибка в котором может привести к провалу проекта.
`*` можно опустить в курсовике 
---- ### Наименование проблемы (Issue) State the architectural design issue being addressed. This should leave no questions about the reason why this issue is to be addressed now. ### Решение (Decision) Clearly state the solution chosen. ### * Статус: pending | decided | approved State the status of the decision, such as pending, decided, or approved. (This is not the status of implementing the decision.) ### * Группа (Group) Grouping allows for filtering based on technical stakeholder interests. A simple group label, such as "integration," "presentation," "data," and so on can be used to help organize the set of decisions. ---- ### Предположения (Assumptions) Clearly describe the underlying assumptions in the environment in which a decision is being made. These could be cost, schedule, technology, and so on. Note that constraints in the environment (such as a list of accepted technology standards, an enterprise architecture, or commonly employed patterns) may limit the set of alternatives considered.  ---- ### Альтернативы (Alternatives)
List alternatives considered. Explain alternatives with sufficient detail to judge their suitability; refer to external documentation if necessary. Only **viable positions** should be described here. But we don't want to hear the question "Did you think about...?" during a review.

---- ### Аргументы (Argument) Outline why a position was selected. This is probably as **important as the decision itself**. The argument for a decision can include items such as implementation cost, total cost of ownership, time to market, and availability of required development resources. ### Последствия (Implications) Describe the decision's implications. For example: - Introduce a need to make other decisions - Create new or modify existing requirements - Pose additional constraints to the environment - Require renegotiation of scope - Require renegotiation of the schedule with customers - Require additional training for staff ---- ### * Связанные решения (Related Decisions) List decisions related to this one (traceability matrix or decision tree or diagrammatically). Useful relations among decisions include causality, structure, or temporality. ### Связанные требования (Related Requirements) Map decisions to objectives or requirements. Each architecture decision is assessed as to its contribution to each major objective. ### * Связанные артефакты (Affected Artifacts) List the architecture elements and/or relations affected by this decision. Also: the effects on other scope decisions, management artifacts such as budgets and schedules. ### * Заметки (Notes) Capture notes and issues that are discussed during the decision process. --- ## Ключевые аспекты архитектурных представлений 1. Behavior Diagram 1. Context Diagram 1. Interface Diagram Представление, язык и нотация определяются нуждами заинтересованных сторон. Обычно аспекты смешиваются (подробности в разделе архитектурных стилей). --- ### Behavior Diagram #### Сценарии использования. Последовательности   1. Взаимодействие пользователя с функциями системы и операционным окружением (UML: Use case diagram). 2. Реакция системы (её компонент) на действие пользователя
(UML: Sequence diagram). ---- #### Порядок взаимодействия компонент в системе  ---- #### Пошаговый алгоритм поведения системы   1. Алгоритмическое описание (UML: Activity diagram) 2. Структурное описание / описание интерфейсов. ---- #### Алгоритм поверх диаграммы развёртывания  ---- #### Состояние системы и переходы  ---- #### Вложенные состояния системы и переходы  --- ### Context Diagram  Операционное окружение с разных точек зрения:
состав, интерфейсы, поведение. --- ### Interface Diagram


Интерфейс — основа вариативности, расширяемости и гибкости
для любой системы. --- ## Формирование инструмента архитектурного представления Инструмент складывается из: 1. нотации 1. подхода 1. архитектурных стилей ---- ## Notations for Architecture Views
1. **Informal notations**. Views are depicted (often graphically) using general-purpose diagramming. The semantics are in natural language. 2. **Semiformal notations**. Views are expressed in a standardized notation that prescribes graphical elements and rules of construction, but does not provide a complete semantic treatment (e.g., UML). 3. **Formal notations**. Views are described in a notation that has a precise (usually mathematically based) semantics (Architecture description language — ADL).

---- ### Выбор нотации  - Чем раньше, тем "легче" нотация для снижения затрат на внесение изменений. - Чем позднее, тем выше детализация и формализация для автоматизации. ---- ### Подход к рассмотрению архитектуры

**$\leftrightarrow$ Горизонтальный** — рассмотрение системы в рамках одного уровня организации: - язык программирования; - микросервисы; - сетевое взаимодействие. -------------------- **$\updownarrow$ Вертикальный** — рассмотрение взаимодействия уровней организации между собой: - программа на C и её машинный код; - машинный код и процессор; - код IEC 61499 и группа ПЛК.
--- ### Архитектурный стиль
Архитектурный стиль (framework)
соглашения, принципы, практики для описания архитектуры, созданной для конкретной области применения и/или заинтересованных сторон (перевод ISO 42010).

Качество архитектурных спецификаций выражается в совокупном снижении затрат заинтересованных сторон (stakeholders) на протяжении всего жизненного цикла системы. ---- ## Классы архитектурных стилей
Module Styles
Работа с артефактами разработки (документацией).
--------------------
Component & Connector Styles
Работа с элементами системы времени исполнения.
--------------------
Allocation Styles
Отображение между уровнями.
 (Allocation Styles)
----
### Modules vs. Components
Модуль
элемент проектной документации (класс, дистрибутив, библиотека).
--------------------
Компонент
элемент системы времени исполнения (экземпляр, сервис, процесс).
 
---- #### Выбор архитектурного стиля под stakeholder-а  --- ## Module Styles  - Про документацию проекта (исходный код). ---- ### Decomposition Style
 - Простая декомпозиция системы на модули. - В чистом виде на практике практически не используется.
 
---- ### Uses Style /1
 - Декомпозиция и использование одними модулями других. - Планирование разработки. - Отладка и составление планов регрессионного тестирования.
 
---- ### Uses Style /2. Complex Example


Графический и текстовый язык документирования. ---- ### Generalization Style
   - Вариативность кода системы. - Сценарии повторного [частичного] использования.

---- ### Layered Style
 - Формирование вычислительной платформы. - Разделение интересов и уровней абстракций.
  
---- ### Aspect Style
 - Анализ "сквозных" ограничений в системе (права доступа, журналирование, валидация и верификация данных). - Повторное использование и изоляция.
 
---- ### Data Model
 - Представление предметной области. - Структура и корректность представления данных в системе. - Механизмы доступа и обработки данных.
 
--- ## Component & Connector Styles  - Отображение элементов системы времени исполнения. - Демонстрация того, как система функционирует во время работы. ---- ### Data Flow Style /1
 - Этапы и обработчики данных. - Форматы данных между ними.
 
---- #### Data Flow Style /2  ---- #### Data Flow Style /3. Node programming  ---- ### Call-Return Style /1  ---- #### Call-Return Style /2   - Цепочки вызовов и взаимосвязей компонент. - Интерфейсы подключения и взаимодействия. - Показать поток управления. ---- ### Event-Based Style
 - Реактивные системы. - Множество событий, открытый список обработчиков.

---- ### Repository Style
 - Системы, выстроенные вокруг баз данных. - Разделение данных.

---- ### Component & Connector Styles. Frankenstein  --- ## Allocation Styles  Отображение элементов архитектуры разрабатываемой системы на: - операционное окружение - обеспечивающие системы ---- ### Deployment Style   ---- ### Install Style   ---- ### Work Assignment Style  