Core ConceptsΒΆ
Welcome to the Core Concepts guide! This section explains the architectural patterns and principles that Neuroglia is built upon. Each concept is explained for beginners - you don't need prior knowledge of these patterns.
π― Why These Patterns?ΒΆ
Neuroglia enforces specific architectural patterns because they solve real problems in software development:
- Maintainability: Code that's easy to change as requirements evolve
- Testability: Components that can be tested in isolation
- Scalability: Architecture that grows with your application
- Clarity: Clear separation of concerns and responsibilities
π Concepts OverviewΒΆ
Architecture PatternsΒΆ
-
Clean Architecture - Organizing code in layers with clear dependencies
-
Problem it solves: Tangled code where everything depends on everything
-
Key benefit: Business logic independent of frameworks and databases
-
Dependency Injection - Providing dependencies instead of creating them
- Problem it solves: Hard-coded dependencies that make testing difficult
- Key benefit: Loosely coupled, testable components
Domain-Driven DesignΒΆ
-
Domain-Driven Design Basics - Modeling your business domain
-
Problem it solves: Business logic scattered across services
-
Key benefit: Rich domain models that encapsulate business rules
-
Aggregates & Entities - Building blocks of your domain
- Problem it solves: Unclear boundaries and consistency rules
- Key benefit: Clear transaction boundaries and data consistency
Application PatternsΒΆ
-
CQRS (Command Query Responsibility Segregation) - Separating reads from writes
-
Problem it solves: Single model trying to serve both read and write operations
-
Key benefit: Optimized read and write paths, better scalability
-
Mediator Pattern - Request routing and handling
-
Problem it solves: Controllers knowing about specific handlers
-
Key benefit: Loose coupling, easy to add cross-cutting concerns
-
Event-Driven Architecture - Reacting to business occurrences
- Problem it solves: Tight coupling between components
- Key benefit: Extensible, loosely coupled systems
Data PatternsΒΆ
-
Repository Pattern - Abstracting data access
-
Problem it solves: Domain code coupled to database
-
Key benefit: Testable, swappable data access
-
Unit of Work - Managing transactions
- Problem it solves: Manual transaction management and event publishing
- Key benefit: Consistent transactional boundaries
π¦ Learning PathΒΆ
New to these concepts? Follow this path:
- Start here: Clean Architecture
- Then learn: Dependency Injection
- Domain modeling: Domain-Driven Design
- Application layer: CQRS β Mediator
- Integration: Event-Driven Architecture
- Data access: Repository β Unit of Work
Already familiar? Jump to any concept for Neuroglia-specific implementation details.
π‘ How to Use These GuidesΒΆ
Each concept guide includes:
- β The Problem: What happens without this pattern
- β The Solution: How the pattern solves it
- π§ In Neuroglia: How to implement it in the framework
- π§ͺ Testing: How to test code using this pattern
- β οΈ Common Mistakes: Pitfalls to avoid
- π« When NOT to Use: Scenarios where simpler approaches work better
π See It In ActionΒΆ
All concepts are demonstrated in the Mario's Pizzeria tutorial:
- Part 1 shows Clean Architecture and Dependency Injection
- Part 2 covers Domain-Driven Design and Aggregates
- Part 3 demonstrates CQRS and Mediator
- Part 5 explores Event-Driven Architecture
- Part 6 implements Repository and Unit of Work
π Additional ResourcesΒΆ
- Tutorials: Step-by-step Mario's Pizzeria guide
- Features: Framework feature documentation
- Patterns: Advanced pattern examples
- Case Study: Complete Mario's Pizzeria analysis
Ready to dive in? Start with Clean Architecture to understand the foundation of Neuroglia's approach!