ข้ามไปยังเนื้อหา

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.

Existing conceptCephalonEngine equivalent
IModule (hand-rolled)IModule from Cephalon.Abstractions.Modules
IRequestHandler<T> (MediatR)IRestBehavior for HTTP, IMessageHandler<T> for events
IServiceCollection extensionsRegisterServices(IServiceCollection) on the module
IPipelineBehavior<T>engine-blessed decorators in the behavior pipeline
Module startupOnRegister / OnStart lifecycle hooks
Module configEngine:<ModuleName>:* configuration section

For each existing module:

  1. Inherit from RestBehaviorModuleBase (or the matching transport base).
  2. Implement Describe() to declare the descriptor.
  3. Move existing DI registrations into RegisterServices(...).
  4. Convert MediatR handlers into behaviors / message handlers.
  5. Adopt the manifest — let the runtime tell you what’s loaded.
  • The composition smoke tests pass with the same module set you had before.
  • /engine/manifest lists every module.
  • The OpenAPI shape is identical (or improves, because behaviors auto-document better than MapGet chains).

Full step-by-step lands in the next docs push. Until then, From plain ASP.NET Core is the closest analogue.