Skip to content

MiCake Introduction

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.

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.

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

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” 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

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

MiCake is particularly suitable for the following scenarios:

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
  • .NET Core 10.0 or later
  • Visual Studio Code (recommended)
  • or Visual Studio 2026 or later

As a lightweight toolkit, MiCake has a negligible impact on performance:

  • Minimal runtime overhead: core abstractions are based on interfaces, which JIT optimizes well
  • On-demand loading: modular design, only loads the features you use
  • No reflection abuse: avoids reflection on critical paths
  • Memory friendly: reasonable object lifecycle management
  • Bug reports: submit bugs or feature requests via GitHub Issues
  • Discussions: discuss usage questions in GitHub Discussions
  • Tech blog: follow the author’s blog for the latest updates

We welcome community contributions! You can:

  • Submit a Pull Request to improve the code
  • Improve documentation and examples
  • Share usage experience and best practices
  • Help answer other users’ questions

MiCake follows Semantic Versioning (SemVer):

  • Major version: incompatible API changes
  • Minor version: backward-compatible feature additions
  • Patch version: backward-compatible bug fixes

The current version supports .NET 10.0+, and will continue to follow new .NET releases in the future.