Search⌘ K

Responsibilities of a Web Adapter

Explore the responsibilities of a web adapter in Hexagonal Architecture, including transforming HTTP requests into domain models, performing authorization and validation, calling use cases, and managing responses. Understand how to maintain a clean separation between the web layer and application core to enable modularity and flexibility.

We'll cover the following...

The web adapter

What does a web adapter actually do? Let’s say we want to provide a RESTRepresentational State Transfer APIApplication Programming Interface for our BuckPal application. Where do the responsibilities of the web adapter start and where do they end?

A web adapter usually does these things:

  1. Maps HTTPHypertext Transfer Protocol request to Java objects
  2. Performs authorization checks
  3. Validates input
  4. Maps input to the input model of the use case
  5. Calls the use case
  6. Maps output of the use case back to HTTPHypertext Transfer Protocol
...