Cohesive Systems logoCOHESIVE SYSTEMS

Search Cohesive Systems

Ready

Search Cohesive Systems

Find product pages, building blocks, technical articles, and graph definitions.

Service

A service is a boundary-relative role in which a provider makes a capability available to a consumer through a contract. The role says what can be requested, observed, or relied upon at that boundary; it does not by itself determine where the behavior is implemented, whether it runs in another process, how it is deployed, or which team owns it.

The unqualified word service is therefore incomplete in a system model. The capability, provider observer, interaction contract, semantic authority, code, deployment, runtime process, and organizational owner may have different identities and lifecycles.

Qualified Meanings

TermCenter of gravityCohesive correspondenceDoes not imply
Domain servicedomain semantics and DDDA domain operation, policy, transition, or process expressed in the domain language when responsibility does not naturally belong to one entity or value. Its interface and decisions belong to the domain model.An application coordinator, network endpoint, daemon, or independently deployed service.
Application service or Service Layersystem graph and architecture practiceAn application-boundary observer role that admits commands or queries, coordinates domain work, transactions, and effects, and returns observations.New domain meaning merely because it coordinates domain behavior.
Background service or daemonrealization substrateA runtime-managed process, worker, or application host activated by boot, timers, queues, files, messages, or other triggers and governed by lifecycle and scheduling mechanisms.A domain service, application boundary, or microservice.
Microservicearchitecture practice spanning several realmsAn independently evolvable service boundary whose semantic responsibilities, interactions, guarantees, code, ownership, deployment, and runtime realization are deliberately aligned.A fixed code size, one module, one repository, one process, one team, or one bounded context.
Queueing serviceanalytical and operational languageProcessing supplied by a service center, described by service time, service rate, capacity, and queue discipline.Any of the software-architecture meanings above.

Relationships among the Meanings

One microservice may expose several application services, run several background workers, and use domain services inside its model. The same domain service can be realized inside a modular monolith, microservice, command handler, workflow activity, or background worker. An application service can be invoked locally or exposed through a remote endpoint. A daemon may host a microservice or perform supporting infrastructure work, but running out of process does not make it a microservice.

Encapsulation and Bundling

The common role across these meanings is encapsulation. A service bundles some internal structure and presents a more stable, selective interaction surface to consumers:

service = encapsulated internal subgraph
        + provided interfaces
        + required interfaces
        + declared guarantees
        + accountable ownership

The internal subgraph may contain entities, policies, domain services, queries, processes, code modules, storage, workers, or calls to other services. Its interfaces expose capabilities without requiring consumers to know that internal arrangement. This is boundary-relative: a composite service may encapsulate several downstream services for one consumer while appearing as a dependency node to another.

Encapsulation can be semantic, structural, operational, organizational, or some combination. A model should say which internal changes consumers are protected from and which guarantees remain valid across the interface.

Facades, Gateways, and Services

The GoF Facade pattern has a close structural correspondence: it provides a unified, simplified interface to a subsystem. A service can act as a facade, but service is the broader role. A service interface may carry semantic authority, remote failure, compatibility, security, throughput, and operational commitments that an object-oriented facade does not imply.

RolePrimary purpose
FacadeSimplifies access to an internal subsystem without implying a deployment or network boundary
AdapterTranslates one interface or representation into another
GatewayControls or translates passage across an external, trust, protocol, or topology boundary
AggregatorCombines correlated results or values under an explicit completion rule
ServiceProvides a capability while encapsulating how it is realized

A single node can fulfill several of these roles, but naming each role separately exposes its obligations.

Capability and Composition Roles

Industry terminology varies, so a service should be classified on two independent axes: whether it owns semantic authority and whether it primarily realizes behavior locally or composes dependencies.

Semantic roleRealization roleRecommended description
Owns a domain capabilityPrimarily localCapability-owning service
Owns a domain capabilitySubstantially composes dependenciesCapability-owning composition service
Does not own domain semanticsProvides reusable technical behaviorTechnical or utility service
Does not own domain semanticsRoutes, translates, aggregates, or coordinates dependenciesComposition service, qualified as gateway, aggregator, facade, or orchestrator

Composition is not synonymous with semantic emptiness. A composition service owns domain semantics when it decides domain-valid sequencing, eligibility, policy, or outcomes; it is composition-only when it preserves the authority and meanings of downstream capabilities while changing their accessibility or presentation.

The same distinction applies at the operation level:

Operation roleMeaning
Authoritative commandDecides or records a semantic transition under local authority
Local queryReads locally governed state or a declared projection
Delegating operationPreserves another capability's meaning while invoking its provider
Routing operationSelects a destination without combining semantic results
Aggregate queryCombines several observations under an explicit completeness rule
Composite commandCoordinates several commands and owns the exposed outcome contract
Process operationStarts, advances, signals, or observes a semantic process
Translating operationAdapts shape, protocol, or vocabulary across boundaries

Service models use these roles to distinguish a service's visible node from the entities, relations, queries, processes, and dependencies it encapsulates.

The direction of realization is therefore:

domain capability or operation
  -> application-boundary coordination
  -> code modules and interaction contracts
  -> deployment units and runtime processes
  -> scheduler-managed executions

This is a possible correspondence, not an identity chain. A layer may be absent, combined with another layer, or realized in several ways.

Modeling Discipline

When using service, state:

  • Which capability is provided, to whom, and at which boundary?
  • Which observer interprets the request, message, timer, or other input?
  • Where do domain rules, transition authority, coordination, and effects belong?
  • Which provided and required interfaces declare the available interactions and semantic contracts?
  • Which interaction protocols govern ordering, concurrency, completion, cancellation, and failure?
  • Which channels and network bindings realize those interfaces?
  • Which operational guarantees apply to delivery, ordering, consistency, recovery, and compatibility?
  • Which code modules, repositories, build artifacts, deployment units, runtime instances, and schedulers realize the role?
  • Which team owns semantic change, contract evolution, deployment, and operation?

Names such as CustomerService, a /services directory, a service-manager unit, or a network endpoint are realization evidence, not proof of any particular service meaning.

External References

  • Eric Evans, Domain-Driven Design Reference, especially the Service pattern.
  • Randy Stafford, Service Layer, Patterns of Enterprise Application Architecture.
  • Erich Gamma et al., Design Patterns: Elements of Reusable Object-Oriented Software, Facade, 1994.
  • Refactoring.Guru, Facade.
  • Linux man-pages project, daemon(7).
  • James Lewis and Martin Fowler, Microservices, 2014.

Related concepts: system language and realization, pattern languages and correspondence, service models, interfaces, interaction protocols, multiplexing and demultiplexing, domain-driven design, enterprise application patterns, microservices, modular monolith, queueing theory, observer, observer models, process, interaction, command, query, effect, boundaries, authority, scheduling, application hosts, runtimes, realization.