Service application facet

Table of Contents

Summary

The service application facet is the runnable-process projection of a domain service: the application class, its host, the configuration options and parser, and the main() entry point that ores.codegen generates under --profile service. It turns a domain component into a deployable NATS service with consistent start-up, configuration and logging, so every service in the fleet is wired the same way.

Detail

The facet sits at the top of the entity lifecycle's service side. It emits the scaffolding a domain service needs to run:

  • Application — the service class that owns the domain handlers and the NATS connection.
  • Host — the process host that wires the application into the runtime (logging, lifecycle, signals).
  • Configuration — the options struct and its command-line / file parser.
  • Entry point — the main() that constructs and runs the host.

The business logic is hand-written; the facet generates the boilerplate around it. Read the template for the authoritative output rather than reproducing it here.

See also

  • Facet — the MASD facet concept this instantiates.
  • Applied MASD — the full facet catalogue and codegen routes.
  • cpp_service_app — the literate templates that generate this facet.
  • Entity lifecycle — where the service facet sits in the layer ordering.

Emacs 29.1 (Org mode 9.6.6)