Логотип Nw Architectural Styles Tradeoffs

Nw Architectural Styles Tradeoffs

Організація
nWave-ai
nw-architectural-styles-tradeoffs

Architectural style selection decision matrices, trade-off analysis, structural enforcement rules, and combination patterns. Load when choosing or evaluating architecture styles.

Огляд

ВидавецьnWave-ai
РепозиторійnWave
Назва навичкиnw-architectural-styles-tradeoffs
Зірки
616
Форки
65
Файли в пакеті
Лише інструкції
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Усе необхідне — в інструкціях

    Усе потрібне моделі міститься в інструкціях — жодних додаткових файлів для синхронізації.

  • Відкритий вихідний код

    Видавець на GitHub: nWave-ai. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Nw Architectural Styles Tradeoffs у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/nWave-ai/nWave/tree/main/nWave/skills/nw-architectural-styles-tradeoffs
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/nWave-ai/nWave.git /tmp/nWave
mkdir -p .claude/skills
cp -r /tmp/nWave/nWave/skills/nw-architectural-styles-tradeoffs .claude/skills/nw-architectural-styles-tradeoffs
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Nw Architectural Styles Tradeoffs в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Nw Architectural Styles Tradeoffs, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Nw Architectural Styles Tradeoffs не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

Architectural Styles: Selection and Trade-offs

Style Selection Decision Tree

Start here. Answer the dominant driver, follow to recommended style.

Is the domain complex with rich business rules?
  YES -> Do you need infrastructure independence and high testability?
    YES -> Hexagonal / Clean / Onion (functionally equivalent, different terminology)
    NO  -> Is the domain well-understood with clear module boundaries?
      YES -> Modular Monolith (single deployment, structured boundaries)
      NO  -> Layered Architecture (simple, well-known, fast to start)
  NO -> Is this a feature-heavy application with independent feature teams?
    YES -> Vertical Slice (per-feature organization, CQRS-friendly)
    NO  -> Do you need independent deployment and scaling per capability?
      YES -> Can the team handle distributed system operational complexity?
        YES -> Microservices
        NO  -> Modular Monolith (extract to services later)
      NO  -> Is the primary concern async workflows or event-driven processing?
        YES -> Event-Driven Architecture
        NO  -> Is this a data processing pipeline?
          YES -> Pipe and Filter
          NO  -> Layered Architecture (sensible default)

Cross-Cutting Comparison Matrix

StyleDep. DirectionOrganizationDeploymentBest ForTeam Size
Hexagonal/Clean/OnionInward (DIP)Ports + adaptersSingle processInfrastructure-agnostic domainsAny
Layered (N-Tier)Top-downHorizontal layersSingle/multi-tierSimple CRUD, rapid developmentSmall-medium
Vertical SlicePer-featureFeature foldersSingle processFeature-heavy, CQRS systemsMedium-large
MicroservicesPer-serviceService boundariesDistributedIndependent teams, polyglotLarge
Event-DrivenPub-subEvents + handlersDistributedAsync workflows, audit, decouplingMedium-large
CQRSRead/write splitCommand + query modelsSingle or distributedDifferent read/write scalingMedium
Pipe and FilterData flowSequential filtersSingle or distributedETL, data processingAny
Modular MonolithInward per moduleDomain modulesSingle processStructured monolith, future extractionSmall-medium

When-to-Use / When-NOT Decision Matrix

Hexagonal / Clean / Onion (equivalent patterns, different names)

Use WhenAvoid When
Multiple client types consume same domain logicSimple CRUD with single data store
UI/DB technologies need periodic refreshLatency-critical paths (added indirection)
High testability required -- domain testable without infraSmall team where adapter overhead outweighs benefit
Alignment with DDD desiredApplication will never change infrastructure

Vertical Slice

Use WhenAvoid When
Teams understand code smells and refactoring patternsTeams unfamiliar with refactoring -- slices diverge
Feature-heavy apps where changes affect one featureHeavy cross-cutting concerns (shared validation, auth)
CQRS systems with independent commands/queriesEarly projects with poorly understood domain
Minimize cross-cutting changes on new featuresNeed strong architectural governance

Microservices

Use WhenAvoid When
Multiple teams need independent deployment cyclesSmall teams (operational overhead per service)
Different system parts need different tech stacksGreenfield with unclear boundaries -- start modular monolith
Independent scaling of capabilities adds valueStrong transactional consistency required across boundaries
Organization supports operational complexityRisk of "grains of sand" anti-pattern

Modular Monolith

Use WhenAvoid When
Greenfield with unclear domain boundariesIndependent deployment of components required
Non-trivial complexity benefiting from module isolationDifferent modules need different tech stacks
Module autonomy without distributed overheadTeam ready for microservices operational complexity
Microservice-like structure with monolith simplicity--

Event-Driven / CQRS

Use WhenAvoid When
Loose coupling between producers and consumersSimple request-response applications
Workflows spanning multiple services (eventual consistency)Strong immediate consistency required
Complete audit trails needed (event sourcing)Team unfamiliar with eventual consistency
Read/write workloads have very different scaling needsSimple CRUD where two models add unjustified overhead

Pipe and Filter

Use WhenAvoid When
Processing decomposes into independent, reorderable stepsRequest-response requiring synchronous completion
Steps have different scalability requirementsSteps must execute as single transaction
Flexibility to add/remove/reorder steps neededSteps require significant shared state
ETL, image processing, compiler pipelines--

Combination Patterns

Styles are composable. The "Explicit Architecture" approach (Herberto Graca) combines:

PatternRole in Combined Architecture
HexagonalFramework connecting external tools to the core
OnionOrganizes layers within the hexagon
DDDSupplies domain concepts and bounded contexts
CleanReinforces dependency inversion rules
CQRSSeparates commands from queries within each bounded context

Practical rule: hexagonal/clean/onion are the SAME pattern with different terminology. All enforce DIP with inward dependency flow. Pick one vocabulary and use it consistently.

Enforceable Structural Rules

Architecture rules are only real if they are enforced. Key rules by style:

Hexagonal

RuleEnforcement
Domain has zero imports from adapters/infraimport-linter (Python), ArchUnit (Java), ArchUnitTS (TS)
All external communication via port interfacesCode review + architecture tests
No adapter-to-adapter dependenciesPackage dependency check
All dependencies point inward toward domainLayer dependency rule

Modular Monolith

RuleEnforcement
No cross-module database accessSchema ownership tests
Interface-only communication between modulesModule independence contract
No circular dependencies between modulesCycle detection
Module internals inaccessible from outsidePackage/import visibility rules

Vertical Slice

RuleEnforcement
Slices must not import from other slicesIndependence contract
All code for a feature resides within its sliceContainment check
Cross-slice communication via events/contracts onlyImport rules

Architecture Enforcement Tooling

LanguageToolApproach
Java/KotlinArchUnitFluent API unit tests, predefined architecture rules
TypeScript/JSArchUnitTSFile-based dependency rules, Jest/Vitest integration
TypeScript/JSdependency-cruiserComprehensive dependency analysis, JSON/dot/HTML reports, .dependency-cruiser.js config, widely adopted
Pythonimport-linterConfig-based contracts (forbidden, layers, independence)
PythonPyTestArchpytest-based architecture tests
Pythonpytest-archonpytest-native architecture tests, modern alternative to import-linter, decorator-based rules
.NETNetArchTestNUnit/xUnit architecture rules
Gogo-arch-lintYAML-based dependency rules

Python Example (import-linter)

ini
[importlinter:contract:hexagonal-domain]
name = Domain must not import from infrastructure
type = forbidden
source_modules = myapp.domain
forbidden_modules = myapp.infrastructure, myapp.adapters

[importlinter:contract:module-independence]
name = Feature modules must be independent
type = independence
modules =
    myapp.modules.orders
    myapp.modules.billing
    myapp.modules.shipping

Run lint-imports in CI as first-stage fast check (analyzes imports, no I/O).

Common Anti-Patterns

Anti-PatternStyleSignalFix
Shared databaseMicroservicesServices query each other's tablesDatabase per service; API contracts
Distributed monolithMicroservicesServices deploy togetherRe-evaluate boundaries; consider modular monolith
Grains of sandMicroservicesToo-fine-grained services, constant coordinationMerge into coarser services aligned to bounded contexts
Anemic domain modelLayeredEntities are data bags, logic in servicesMove behavior into entities/value objects
Big ball of mudModular MonolithModule boundaries violated, cross-importsAdd architecture tests, enforce with CI
Pass-through layersCleanLayers that add no value, just forward callsRemove unnecessary layers; keep only those adding behavior

Annotating for Software Crafter

When the architecture document specifies an architectural style, include an enforcement annotation so the software-crafter knows which tooling to set up during DELIVER.

What to Include in the Design Document

  1. Style chosen and the key structural rules that apply (from the Enforceable Structural Rules section above)
  2. Recommended enforcement tool appropriate for the project's language (from the Architecture Enforcement Tooling table)
  3. Specific rules to enforce expressed as constraints the tool can verify

Annotation Format

markdown
## Architecture Enforcement

Style: [Hexagonal | Modular Monolith | Vertical Slice | ...]
Language: [Python | Java | TypeScript | ...]
Tool: [tool name from table above]

Rules to enforce:
- [Rule 1 from Enforceable Structural Rules, e.g., "Domain has zero imports from adapters/infra"]
- [Rule 2, e.g., "No cross-module database access"]

This annotation flows through acceptance-designer to software-crafter, who implements the architecture tests during the GREEN phase alongside the first component that establishes the structural boundary.

Поширені запитання

Що робить навичка ШІ Nw Architectural Styles Tradeoffs?

Architectural style selection decision matrices, trade-off analysis, structural enforcement rules, and combination patterns. Load when choosing or evaluating architecture styles.

Навіщо використовувати Nw Architectural Styles Tradeoffs у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Nw Architectural Styles Tradeoffs — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Nw Architectural Styles Tradeoffs у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/nWave-ai/nWave/tree/main/nWave/skills/nw-architectural-styles-tradeoffs. TypingMind прочитає файл SKILL.md і встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Nw Architectural Styles Tradeoffs?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Nw Architectural Styles Tradeoffs?

Зі скількома забажаєте. У TypingMind ви можете використовувати Nw Architectural Styles Tradeoffs із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Nw Architectural Styles Tradeoffs?

Так. На GitHub цю навичку публікує nWave-ai за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇