شعار 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 يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • مكتفية بذاتها

    كل ما يحتاجه النموذج موجود في التعليمات — لا ملفات إضافية لمزامنتها.

  • مفتوحة المصدر

    نشرها nWave-ai على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Nw Architectural Styles Tradeoffs في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/nWave-ai/nWave/tree/main/nWave/skills/nw-architectural-styles-tradeoffs
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
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؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Nw Architectural Styles Tradeoffs معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Nw Architectural Styles Tradeoffs مجانية؟

نعم. نشرها nWave-ai على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇