--- title: MiCake Introduction description: Learn what MiCake is and what it can do for you --- ## What is `MiCake`? **`MiCake`** is a lightweight `Domain-Driven Design (DDD) toolkit` built on .NET. It helps developers quickly convert existing projects to a DDD style while keeping code simple and flexible. MiCake is not a "framework" in the traditional sense, but a convenient "toolbox". It provides the components and tools needed to practice DDD without forcing you to change your development habits. ## Core Features ### ð Fast Quickly convert your project to a DDD style so you can focus on writing domain code instead of framework configuration. With simple configuration and a small amount of code, you can upgrade an existing project to a DDD architecture. ### ð Standard Implements almost all of the core tactical patterns of DDD: - `Entity`: a domain object with a unique identity - `Value Object`: an immutable object compared by property values - `Aggregate Root`: the root entity of an aggregate, serving as the entry point for external access - `Repository`: provides persistence operations for aggregate roots - `Domain Event`: captures important events that occur in the domain - `Domain Service`: encapsulates domain logic that does not belong to entities or value objects - `Unit of Work`: manages business transactions and data consistency ### ðŊ Convenient Provides common infrastructure features for project development: - **Global exception handling**: unified exception catching and handling - **Unified response format**: standardized API response structure - **Automatic audit**: automatically records creation and modification times of entities - **Soft delete support**: logically deletes entities instead of physically deleting them - **Enhanced dependency injection**: simplifies service registration and lifecycle management - **Rich utilities**: cache, converter, query, resilience, and other practical tools ### ðŠķ Lightweight "Lightweight" is the core design philosophy of MiCake: - **Non-intrusive**: integrates seamlessly into existing projects without changing your coding habits - **Low coupling**: framework code is clearly separated from business code - **Optional usage**: DDD is not mandatory; you can introduce it gradually - **Almost invisible**: when you don't use DDD features, you may not even notice it exists ## Design Philosophy MiCake was positioned as **"a very thin layer"** from the very beginning:
| Philosophy | Description |
|---|---|
| Non-intrusive | MiCake wraps your .NET project without interfering. You can still use your original coding habits, familiar libraries, and tools. It does not force you to adopt a specific coding style or architecture pattern. |
| Freedom & No Constraints | MiCake does not constrain your development style. It simply provides tools and components that you can use selectively. You can use part of MiCake's features and freely combine them with other frameworks and libraries. |
| Not DDD | MiCake itself is not DDD; it simply helps you practice DDD better. DDD is a methodology, while MiCake is a tool for practicing that methodology. You need to understand DDD concepts to use MiCake effectively. |
| Progressive Adoption | You can start with the simplest features and gradually introduce more DDD features: 1. Start with the module system and dependency injection 2. Then introduce entities and repositories 3. Then gradually refine your domain model |
| Scenario | Characteristics |
|---|---|
| New project development | - Want to build a new .NET application using DDD - Need to quickly scaffold a project with a clear architecture - The team is familiar with DDD or wants to learn it |
| Refactoring an existing project | - Want to gradually refactor an existing project to a DDD style - Need to improve code maintainability and testability - Want to introduce a better way of organizing business logic |
| Small and medium enterprise applications | - Business systems with moderate complexity - Need a good architecture but don't want a heavyweight framework - Want to keep the technology stack flexible |
| Learning and practicing DDD | - Learning the concepts and practices of domain-driven design - Need a lightweight DDD reference implementation - Want to apply DDD in real projects |