Dependency Inversion with a Web Adapter

Learn how to implement dependency inversion with a web adapter.

Introduction

Most applications today have some kind of web interface — either a UIUser Interface that we can interact with via web browser or an HTTPHypertext Transfer Protocol APIApplication Programming Interface that other systems can call to interact with our application.

In our target architecture, all communication with the outside world goes through adapters. Let’s discuss how we can implement an adapter that provides such a web interface.

The figure below gives a detailed view of the architecture elements that are relevant to our discussion of a web adapter — the adapter itself and the ports through which it interacts with our application core.

Web adapter with ports

Get hands-on with 1200+ tech skills courses.