Services in PHP

--

Services :

when there are operations that need to be represented, but Entities and Value Objects aren’t the best place, you should consider modeling these operations as Services. In Domain-Driven Design, there are typically three different types of Services you’ll encounter:

Application Services: Operate on scalar types, transforming them into Domain types. A scalar type can be considered any type that’s unknown to the Domain Model. This includes primitive types and types that don’t belong to the Domain.

Domain Services: Operate only on types belonging to the Domain. They contain meaningful concepts that can be found within the Ubiquitous Language. They hold operations that don’t fit well into Value Objects or Entities.

Infrastructure Services: Are operations that fulfill infrastructure concerns, such as sending emails and logging meaningful data. In terms of Hexagonal Architecture, they live outside the Domain boundary.

Application Services

Application Services are the middleware between the outside world and the Domain logic. The purpose of such a mechanism is to transform commands from the outside world into meaningful Domain instructions.

For More on services, visit

https://www.itguidekolkata.in/2021/05/Servicesinphp.html

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response