← Graph

Stateless Service Object

concept 9 connections

Ivan Nemytchenko's take on services, aligned with DDD's 'service is an action, not a thing'. Implement services as classes with class methods (or a single top-level method) rather than instantiated objects, because instance state is where discipline breaks down: an inexperienced developer seeing a class will be tempted to add state. A class-methods-only service makes adding state effectively impossible without resorting to globals. In The Curse of Service Object, Ivan reinforces this: services should be just procedures, written at a high level of abstraction, delegating persistence to mutators and external calls to managers, with application logic kept in the controller. Complements dry-container for swapping external dependencies.

category
pattern
about
Stateless Service Object concept
Proposes class-method services instead of stateful service classes.
about
Stateless Service Object concept
Concrete articulation of the stateless-service pattern.
about
Stateless Service Object concept
The talk advocates stateless procedural services as the replacement for stateful service objects.
about
Stateless Service Object concept
Services-as-procedures are one of the shelves Ivan proposes.
about
Stateless Service Object concept
Question challenges the talk's procedural, non-OOP approach.
recommends
Stateless Service Object concept
Core recommendation of The Curse of Service Object.
concept Stateless Service Object
related_to
Service Object concept
Ivan's stateless procedural services replace stateful service objects.
concept Mutator Layer
related_to
Stateless Service Object concept
Mutators are called by stateless services to handle persistence.
concept Manager Layer
related_to
Stateless Service Object concept
Managers are called by stateless services to handle external-system interactions.

Provenance

Read by
10 extractions