From a modular monolith
เนื้อหานี้ยังไม่ได้แปลเป็นภาษาไทย แสดงเป็นภาษาอังกฤษแทน
If your codebase already uses a “modular monolith” pattern (MediatR-style, or hand-rolled module classes), the lift to CephalonEngine is mostly a renaming exercise + adopting the manifest.
Mapping
Section titled “Mapping”| Existing concept | CephalonEngine equivalent |
|---|---|
IModule (hand-rolled) | IModule from Cephalon.Abstractions.Modules |
IRequestHandler<T> (MediatR) | IRestBehavior for HTTP, IMessageHandler<T> for events |
IServiceCollection extensions | RegisterServices(IServiceCollection) on the module |
IPipelineBehavior<T> | engine-blessed decorators in the behavior pipeline |
| Module startup | OnRegister / OnStart lifecycle hooks |
| Module config | Engine:<ModuleName>:* configuration section |
The diff that matters
Section titled “The diff that matters”For each existing module:
- Inherit from
RestBehaviorModuleBase(or the matching transport base). - Implement
Describe()to declare the descriptor. - Move existing DI registrations into
RegisterServices(...). - Convert MediatR handlers into behaviors / message handlers.
- Adopt the manifest — let the runtime tell you what’s loaded.
Verification
Section titled “Verification”- The composition smoke tests pass with the same module set you had before.
/engine/manifestlists every module.- The OpenAPI shape is identical (or improves, because behaviors auto-document better than
MapGetchains).
Status
Section titled “Status”Full step-by-step lands in the next docs push. Until then, From plain ASP.NET Core is the closest analogue.