{"id":2787,"date":"2025-08-28T07:31:23","date_gmt":"2025-08-28T07:31:23","guid":{"rendered":"https:\/\/inprotech.es\/?p=2787"},"modified":"2025-08-28T07:31:23","modified_gmt":"2025-08-28T07:31:23","slug":"ports-adapters-hexagonal-architecture","status":"publish","type":"post","link":"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/","title":{"rendered":"Ports &#038; Adapters (Hexagonal Architecture)"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">In its evolution throughout its history, software development and the different schools of architecture with traction in the community have been solidifying a series of essential pillars when planning applications: maintainability, scalability and flexibility. Without them in mind, the universal tendency for systems to increase in complexity as they grow establishes a more or less defined ceiling beyond which a program could not grow, at the risk of becoming completely ungraspable by a person trying to enter the project, or tremendously fragile to change and therefore impossible to update and scale.\u00a0<\/span><\/p>\n<figure id=\"attachment_2788\" aria-describedby=\"caption-attachment-2788\" style=\"width: 381px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2788\" src=\"https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/1-1.png\" alt=\"\" width=\"381\" height=\"298\" srcset=\"https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/1-1.png 381w, https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/1-1-300x235.png 300w\" sizes=\"auto, (max-width: 381px) 100vw, 381px\" \/><figcaption id=\"caption-attachment-2788\" class=\"wp-caption-text\">Figure 1: Alistar Cockburn<\/figcaption><\/figure>\n<p><span style=\"font-weight: 400;\">One of these architectures that have earned a place as widely known and used patterns beyond the theoretical circuits is that of Ports and Adapters, proposed in 2005 by Alistair Cockburn<\/span><span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\">, also known for being one of the driving forces behind the Agile<\/span><span style=\"font-weight: 400;\">2<\/span><span style=\"font-weight: 400;\"> methodology. The basic idea of this architecture is the decoupling of the application&#8217;s core from its input and output mechanisms, allowing for greater modularity and testability.\u00a0<\/span><\/p>\n<p><b>InprOTech Guardian<\/b><span style=\"font-weight: 400;\">, our advanced cybersecurity solution for OT networks, is proprietary software written with these architectural principles at its core. In this article we will explore the fundamentals of this architecture, its structure, advantages, disadvantages and how it is implemented in practice.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><b>Origin and Motivation<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Alistair Cockburn introduced the Ports and Adapters architecture as an answer to certain typical problems derived from object-oriented development: excessive and\/or superfluous dependencies between layers, impossibility of replacing elements adjacent to the application by test or test systems, and filtering of business logic outside its application range. Its main objective was to solve the problems of excessive dependency on external interfaces, which hinders the evolution and maintenance of systems.<\/span><\/p>\n<h2><b>Problems in traditional architectures<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Traditional architectures often present problems such as:\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Strong coupling<\/b><span style=\"font-weight: 400;\"> between business logic and infrastructure layers (databases, graphical interfaces, external APIs).\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Difficulty to perform unit tests<\/b><span style=\"font-weight: 400;\">, since the business logic is intertwined with the infrastructure.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Less flexibility<\/b><span style=\"font-weight: 400;\">, as any changes to external components directly impact the core of the application.\u00a0<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">\u00a0The Ports and Adapters architecture seeks to solve these problems by promoting a clear separation between the core business and the outside world.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0In their own words<\/span><span style=\"font-weight: 400;\">3<\/span><span style=\"font-weight: 400;\"> , the following points are the key to this architecture, its \u201c<\/span><i><span style=\"font-weight: 400;\">why<\/span><\/i><span style=\"font-weight: 400;\">\u201d:<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">Create your application to work without a user interface or database so you can run automated tests against it:\u00a0<\/span><\/i><\/p>\n<p><i><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0&#8211; run automated tests against it <\/span><\/i><span style=\"font-weight: 400;\"><br \/>\n<\/span><i><span style=\"font-weight: 400;\">\u00a0 \u00a0 &#8211; work when the database is not available <\/span><\/i><span style=\"font-weight: 400;\"><br \/>\n<\/span><i><span style=\"font-weight: 400;\">\u00a0 \u00a0 &#8211; be open to implementing new technology <\/span><\/i><span style=\"font-weight: 400;\"><br \/>\n<\/span><i><span style=\"font-weight: 400;\">\u00a0 \u00a0 &#8211; connect different applications\u00a0 <\/span><\/i><span style=\"font-weight: 400;\"><br \/>\n<\/span><i><span style=\"font-weight: 400;\">\u00a0 \u00a0 &#8211; protect your code from leaks between business logic and I\/O<\/span><\/i><\/p>\n<figure id=\"attachment_2790\" aria-describedby=\"caption-attachment-2790\" style=\"width: 587px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2790\" src=\"https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/2-1.png\" alt=\"\" width=\"587\" height=\"466\" srcset=\"https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/2-1.png 587w, https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/2-1-300x238.png 300w\" sizes=\"auto, (max-width: 587px) 100vw, 587px\" \/><figcaption id=\"caption-attachment-2790\" class=\"wp-caption-text\">Figure 2: Alistar&#8217;s own architecture diagram<\/figcaption><\/figure>\n<h2><b>The Hexagon and the understandable confusion with the name<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">In the 1990s, when Cockburn began flirting with the idea that would eventually become this pattern, he used a hexagon to represent his system. The reason was that a square introduced a very strong idea of up-down-left-right, which he considered a focus problem, but he needed a figure with radial symmetry and facets to represent the application&#8217;s points of contact with the outside (although he would not identify these points as the ports until 2004). Although the hexagon had no significance whatsoever, nor was six a special or magic number in this context, the name Cockburn christened the pattern had already curdled by the time he decided that the correct name for the architecture, the one that best captures its essence, is Ports and Adapters. Although the author usually emphasizes which is the best name to clarify this possible confusion, the truth is that he does not deny the name Hexagonal Architecture: his book published in 2024 with the Sevillian Juan Manuel Garrido de Paz on this design is entitled <\/span><i><span style=\"font-weight: 400;\">Hexagonal Architecture Explained &#8211; How the Ports &amp; Adapters architecture simplifies your life<\/span><\/i><span style=\"font-weight: 400;\">, <\/span><i><span style=\"font-weight: 400;\">and how to implement it<\/span><\/i><span style=\"font-weight: 400;\">; and he even sells mugs and T-shirts on his website where the hexagon is the protagonist<\/span><span style=\"font-weight: 400;\">4<\/span><span style=\"font-weight: 400;\">.<\/span><\/p>\n<figure id=\"attachment_2792\" aria-describedby=\"caption-attachment-2792\" style=\"width: 308px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2792\" src=\"https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/3-1.png\" alt=\"\" width=\"308\" height=\"277\" srcset=\"https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/3-1.png 308w, https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/3-1-300x270.png 300w\" sizes=\"auto, (max-width: 308px) 100vw, 308px\" \/><figcaption id=\"caption-attachment-2792\" class=\"wp-caption-text\">Illustration 3: Merchandising mug showing the hexagonal logo<\/figcaption><\/figure>\n<h2><b>Principles of Port and Adapter Architecture<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">The Ports and Adapters architecture is based on the following fundamental principles:\u00a0<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0<\/span><b>The core of the application is independent of external details<\/b><span style=\"font-weight: 400;\">: Business logic must be autonomous and not directly dependent on frameworks, databases, APIs or user interfaces.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0<\/span><b>\u00a0Interaction through \u201cports\u201d:<\/b><span style=\"font-weight: 400;\"> Ports are interfaces that define how other components can interact with the business logic.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0<\/span><b>\u00a0Use of \u201cadapters\u201d to connect external interfaces with ports<\/b><span style=\"font-weight: 400;\">: Adapters translate calls between external components and internal ports.<\/span><\/li>\n<\/ol>\n<h3><b>Port and Adapter Architecture Structure<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The architecture is composed of three main elements:\u00a0<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">\u00a0<\/span><b>Application Core<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">\u00a0The core of the application contains all the business logic and domain rules. It is composed of:\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Use cases:<\/b><span style=\"font-weight: 400;\"> represent the actions that the application can perform (e.g., \u201cRegister a user\u201d).\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Domain entities:<\/b><span style=\"font-weight: 400;\"> Model the core business concepts and contain the validation logic.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Domain services:<\/b><span style=\"font-weight: 400;\"> Contain complex business logic that does not belong to a single entity.\u00a0<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">\u00a0This core has <\/span><b>no knowledge<\/b><span style=\"font-weight: 400;\"> of the infrastructure, allowing it to be tested in isolation.\u00a0<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">\u00a0<\/span><b>Ports (Interfaces)\u00a0<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">\u00a0Ports act as contracts that define how external components interact with the application core. There are two types of ports:\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\u00a0<\/span><b>Input Ports:<\/b><span style=\"font-weight: 400;\"> interfaces that expose the application&#8217;s use cases. They are implemented by drivers or application services.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Output Ports: <\/b><span style=\"font-weight: 400;\">Interfaces that represent external dependencies such as databases, third-party APIs or messaging systems.<\/span><\/li>\n<\/ul>\n<h3><b>Adapters<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Adapters implement ports and handle communication between the kernel and the outside world. They can implement inbound ports (handling external requests such as a REST API or a graphical interface) or outbound ports (communicating with databases, external systems, etc.).\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0It is worth mentioning that a system may not have adapters (or rather, following Cockburn&#8217;s usual emphasis on application users over the applications themselves, we might not need adapters).<\/span><\/p>\n<h3><b>Relationship to Separation into Layers (Domain, Application and Infrastructure)<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Alistair Cockburn es muy expl\u00edcito en que su dise\u00f1o solo define la existencia de un \u201cinterior&#8221; y un &#8220;exterior&#8221; en la arquitectura de Puertos y Adaptadores y que solo tiene una capa, la propia aplicaci\u00f3n. Sin embargo, la simplicidad de este patr\u00f3n permite acoplarlo a otros dise\u00f1os, y muchos desarrolladores han adoptado una separaci\u00f3n en <\/span><b>tres capas<\/b><span style=\"font-weight: 400;\">, de m\u00e1s a menos externas:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Infrastructure<\/b><span style=\"font-weight: 400;\">: Implements connectivity with databases, messaging systems, external APIs, etc.<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Application<\/b><span style=\"font-weight: 400;\">: Orchestrate use cases, defining how they should be executed.<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Domain<\/b><span style=\"font-weight: 400;\">: Contains pure business rules and core entities.<\/span><\/li>\n<\/ul>\n<figure id=\"attachment_2794\" aria-describedby=\"caption-attachment-2794\" style=\"width: 226px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2794\" src=\"https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/4-1.png\" alt=\"\" width=\"226\" height=\"223\" \/><figcaption id=\"caption-attachment-2794\" class=\"wp-caption-text\">Figure 4: Typical separation into the three strata, infrastructure, application, and domain.<\/figcaption><\/figure>\n<p><span style=\"font-weight: 400;\">The relationship between these three layers is unidirectional, so that the inner layers can only communicate with the layers that contain them.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This separation draws directly from other paradigms such as Eric Evans&#8217; <\/span><i><span style=\"font-weight: 400;\">Domain-Driven Design<\/span><\/i><span style=\"font-weight: 400;\"> (DDD)<\/span><span style=\"font-weight: 400;\">5<\/span><span style=\"font-weight: 400;\">, Robert C. Martin&#8217;s <\/span><i><span style=\"font-weight: 400;\">Clean Architecuture<\/span><\/i><span style=\"font-weight: 400;\">6<\/span><span style=\"font-weight: 400;\">, and <\/span><i><span style=\"font-weight: 400;\">Onion Architecture<\/span><\/i><span style=\"font-weight: 400;\">7<\/span><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In many cases, and apparently contrary to the author&#8217;s consideration, this separation into three layers of infrastructure, application and domain is a de facto part of Architecture.<\/span><\/p>\n<p style=\"padding-left: 160px;\"><span style=\"font-weight: 400;\">My_project\/<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u2502\u2500\u2500 src\/<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u2502 \u00a0 \u251c\u2500\u2500 application\/<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 ports.py<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u2502 \u00a0 \u251c\u2500\u2500 domain\/<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 model.py<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 services.py<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u2502 \u00a0 \u251c\u2500\u2500 infrastructure\/<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 persistence.py<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u2502 \u00a0 \u2502 \u00a0 \u251c\u2500\u2500 api.py<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u2502 \u00a0 \u251c\u2500\u2500 configuration\/<\/span><\/p>\n<h2><b>Benefits of Ports and Adapters Architecture<\/b><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Decoupling<\/b><span style=\"font-weight: 400;\">: Business logic is not dependent on external infrastructure, allowing changes to the database or interface without affecting the core.<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Stability<\/b><span style=\"font-weight: 400;\">: Because the kernel is independent, unit tests can be performed without the need to configure databases or other external dependencies.<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Flexibility <\/b><span style=\"font-weight: 400;\">and maintainability: Adapters can be easily replaced to support new technologies or integrate new external services.<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Scalability<\/b><span style=\"font-weight: 400;\">: It allows the system to be divided into more manageable and reusable modules.<\/span><\/li>\n<\/ul>\n<h2><b>Challenges<\/b><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Increased initial complexity:<\/b><span style=\"font-weight: 400;\"> Separation into ports and adapters requires more design and structure compared to simple monolithic architectures.<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Over-engineering in small applications: <\/b><span style=\"font-weight: 400;\">This level of abstraction is not always necessary if the application is very simple.<\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>More code and classes: <\/b><span style=\"font-weight: 400;\">More code needs to be written due to the implementation of interfaces and adapters.<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">The Ports and Adapters architecture is a powerful alternative for designing decoupled, flexible and highly testable systems. Its focus on separating the core business and infrastructure allows applications to be more maintainable in the long term, facilitating the evolution of the system without relying on specific technologies.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Although its implementation requires greater planning and initial structure, the benefits it offers in terms of modularity, scalability and ease of testing justify its adoption in projects seeking robustness and flexibility. In addition, its compatibility with other approaches such as Domain-Driven Design (DDD) and Clean Architecture makes it a versatile choice for complex systems.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">However, it is important to assess the context and needs of the project before applying it, as for small or short-term applications, the additional effort may not be justified. Ultimately, understanding the principles behind this architecture and knowing when to apply them is key to building high-quality, sustainable software.<\/span><\/p>\n<p><b>References<\/b><\/p>\n<p><span style=\"font-weight: 400;\">1: <\/span><a href=\"https:\/\/alistair.cockburn.us\/hexagonal-architecture\"><span style=\"font-weight: 400;\">https:\/\/alistair.cockburn.us\/hexagonal-architecture<\/span><\/a><\/p>\n<p><span style=\"font-weight: 400;\">2: <\/span><a href=\"https:\/\/agilemanifesto.org\/\"><span style=\"font-weight: 400;\">https:\/\/agilemanifesto.org\/<\/span><\/a><\/p>\n<p><span style=\"font-weight: 400;\">3: <\/span><a href=\"https:\/\/www.youtube.com\/watch?v=k0ykTxw7s0Y\"><span style=\"font-weight: 400;\">https:\/\/www.youtube.com\/watch?v=k0ykTxw7s0Y<\/span><\/a><span style=\"font-weight: 400;\"> [Hexagonal Architecture @Tech Excellence]<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">4: <\/span><a href=\"https:\/\/alistaircockburn.com\/Everything-else\"><span style=\"font-weight: 400;\">https:\/\/alistaircockburn.com\/Everything-else<\/span><\/a><\/p>\n<p><span style=\"font-weight: 400;\">5: <\/span><a href=\"https:\/\/itequia.com\/en\/domain-driven-design-what-is-it-and-how-to-apply-it-in-my-organization\/\"><span style=\"font-weight: 400;\">https:\/\/itequia.com\/en\/domain-driven-design-what-is-it-and-how-to-apply-it-in-my-organization\/<\/span><\/a><\/p>\n<p><span style=\"font-weight: 400;\">6: <\/span><a href=\"https:\/\/blog.cleancoder.com\/uncle-bob\/2012\/08\/13\/the-clean-architecture.html\"><span style=\"font-weight: 400;\">https:\/\/blog.cleancoder.com\/uncle-bob\/2012\/08\/13\/the-clean-architecture.html<\/span><\/a><\/p>\n<p><span style=\"font-weight: 400;\">7: <\/span><a href=\"https:\/\/jeffreypalermo.com\/2008\/07\/the-onion-architecture-part-1\/\"><span style=\"font-weight: 400;\">https:\/\/jeffreypalermo.com\/2008\/07\/the-onion-architecture-part-1\/<\/span><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In its evolution throughout its history, software development and the different schools of architecture with traction in the community have been solidifying a series of essential pillars when planning applications: maintainability, scalability and flexibility. Without them in mind, the universal tendency for systems to increase in complexity as they grow establishes a more or less&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2799,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17],"tags":[],"class_list":["post-2787","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-techpapers-en"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Ports &amp; Adapters (Hexagonal Architecture) - InprOTech<\/title>\n<meta name=\"description\" content=\"Discover how Alistair Cockburn&#039;s Ports and Adapters (Hexagonal) architecture drives more flexible, scalable, and maintainable software development, with practical examples and key advantages.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ports &amp; Adapters (Hexagonal Architecture) - InprOTech\" \/>\n<meta property=\"og:description\" content=\"Discover how Alistair Cockburn&#039;s Ports and Adapters (Hexagonal) architecture drives more flexible, scalable, and maintainable software development, with practical examples and key advantages.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/\" \/>\n<meta property=\"og:site_name\" content=\"InprOTech\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-28T07:31:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/41.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/inprotech.es\\\/en\\\/ports-adapters-hexagonal-architecture\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/inprotech.es\\\/en\\\/ports-adapters-hexagonal-architecture\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/inprotech.es\\\/#\\\/schema\\\/person\\\/cb0ae1292b18b48c1e89b0e4e7ef15d9\"},\"headline\":\"Ports &#038; Adapters (Hexagonal Architecture)\",\"datePublished\":\"2025-08-28T07:31:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/inprotech.es\\\/en\\\/ports-adapters-hexagonal-architecture\\\/\"},\"wordCount\":1502,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/inprotech.es\\\/en\\\/ports-adapters-hexagonal-architecture\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/inprotech.es\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/41.jpg\",\"articleSection\":[\"Techpapers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/inprotech.es\\\/en\\\/ports-adapters-hexagonal-architecture\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/inprotech.es\\\/en\\\/ports-adapters-hexagonal-architecture\\\/\",\"url\":\"https:\\\/\\\/inprotech.es\\\/en\\\/ports-adapters-hexagonal-architecture\\\/\",\"name\":\"Ports & Adapters (Hexagonal Architecture) - InprOTech\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/inprotech.es\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/inprotech.es\\\/en\\\/ports-adapters-hexagonal-architecture\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/inprotech.es\\\/en\\\/ports-adapters-hexagonal-architecture\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/inprotech.es\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/41.jpg\",\"datePublished\":\"2025-08-28T07:31:23+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/inprotech.es\\\/#\\\/schema\\\/person\\\/cb0ae1292b18b48c1e89b0e4e7ef15d9\"},\"description\":\"Discover how Alistair Cockburn's Ports and Adapters (Hexagonal) architecture drives more flexible, scalable, and maintainable software development, with practical examples and key advantages.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/inprotech.es\\\/en\\\/ports-adapters-hexagonal-architecture\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/inprotech.es\\\/en\\\/ports-adapters-hexagonal-architecture\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/inprotech.es\\\/en\\\/ports-adapters-hexagonal-architecture\\\/#primaryimage\",\"url\":\"https:\\\/\\\/inprotech.es\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/41.jpg\",\"contentUrl\":\"https:\\\/\\\/inprotech.es\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/41.jpg\",\"width\":1200,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/inprotech.es\\\/en\\\/ports-adapters-hexagonal-architecture\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\\\/\\\/inprotech.es\\\/en\\\/pagina-de-inicio\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ports &#038; Adapters (Hexagonal Architecture)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/inprotech.es\\\/#website\",\"url\":\"https:\\\/\\\/inprotech.es\\\/\",\"name\":\"InprOTech\",\"description\":\"The Cybersecurity Solution for the Industrial Environment\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/inprotech.es\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/inprotech.es\\\/#\\\/schema\\\/person\\\/cb0ae1292b18b48c1e89b0e4e7ef15d9\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d903daf71b546605502fd9841b9dc598cc8d3a04ee26680ca18eb3633e5209be?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d903daf71b546605502fd9841b9dc598cc8d3a04ee26680ca18eb3633e5209be?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d903daf71b546605502fd9841b9dc598cc8d3a04ee26680ca18eb3633e5209be?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\\\/\\\/inprotech.es\"],\"url\":\"https:\\\/\\\/inprotech.es\\\/en\\\/author\\\/moon\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ports & Adapters (Hexagonal Architecture) - InprOTech","description":"Discover how Alistair Cockburn's Ports and Adapters (Hexagonal) architecture drives more flexible, scalable, and maintainable software development, with practical examples and key advantages.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/","og_locale":"en_US","og_type":"article","og_title":"Ports & Adapters (Hexagonal Architecture) - InprOTech","og_description":"Discover how Alistair Cockburn's Ports and Adapters (Hexagonal) architecture drives more flexible, scalable, and maintainable software development, with practical examples and key advantages.","og_url":"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/","og_site_name":"InprOTech","article_published_time":"2025-08-28T07:31:23+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/41.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/#article","isPartOf":{"@id":"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/"},"author":{"name":"admin","@id":"https:\/\/inprotech.es\/#\/schema\/person\/cb0ae1292b18b48c1e89b0e4e7ef15d9"},"headline":"Ports &#038; Adapters (Hexagonal Architecture)","datePublished":"2025-08-28T07:31:23+00:00","mainEntityOfPage":{"@id":"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/"},"wordCount":1502,"commentCount":0,"image":{"@id":"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/#primaryimage"},"thumbnailUrl":"https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/41.jpg","articleSection":["Techpapers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/","url":"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/","name":"Ports & Adapters (Hexagonal Architecture) - InprOTech","isPartOf":{"@id":"https:\/\/inprotech.es\/#website"},"primaryImageOfPage":{"@id":"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/#primaryimage"},"image":{"@id":"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/#primaryimage"},"thumbnailUrl":"https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/41.jpg","datePublished":"2025-08-28T07:31:23+00:00","author":{"@id":"https:\/\/inprotech.es\/#\/schema\/person\/cb0ae1292b18b48c1e89b0e4e7ef15d9"},"description":"Discover how Alistair Cockburn's Ports and Adapters (Hexagonal) architecture drives more flexible, scalable, and maintainable software development, with practical examples and key advantages.","breadcrumb":{"@id":"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/#primaryimage","url":"https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/41.jpg","contentUrl":"https:\/\/inprotech.es\/wp-content\/uploads\/2025\/08\/41.jpg","width":1200,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/inprotech.es\/en\/ports-adapters-hexagonal-architecture\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/inprotech.es\/en\/pagina-de-inicio\/"},{"@type":"ListItem","position":2,"name":"Ports &#038; Adapters (Hexagonal Architecture)"}]},{"@type":"WebSite","@id":"https:\/\/inprotech.es\/#website","url":"https:\/\/inprotech.es\/","name":"InprOTech","description":"The Cybersecurity Solution for the Industrial Environment","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/inprotech.es\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/inprotech.es\/#\/schema\/person\/cb0ae1292b18b48c1e89b0e4e7ef15d9","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d903daf71b546605502fd9841b9dc598cc8d3a04ee26680ca18eb3633e5209be?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d903daf71b546605502fd9841b9dc598cc8d3a04ee26680ca18eb3633e5209be?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d903daf71b546605502fd9841b9dc598cc8d3a04ee26680ca18eb3633e5209be?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/inprotech.es"],"url":"https:\/\/inprotech.es\/en\/author\/moon\/"}]}},"_links":{"self":[{"href":"https:\/\/inprotech.es\/en\/wp-json\/wp\/v2\/posts\/2787","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/inprotech.es\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/inprotech.es\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/inprotech.es\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/inprotech.es\/en\/wp-json\/wp\/v2\/comments?post=2787"}],"version-history":[{"count":1,"href":"https:\/\/inprotech.es\/en\/wp-json\/wp\/v2\/posts\/2787\/revisions"}],"predecessor-version":[{"id":2800,"href":"https:\/\/inprotech.es\/en\/wp-json\/wp\/v2\/posts\/2787\/revisions\/2800"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/inprotech.es\/en\/wp-json\/wp\/v2\/media\/2799"}],"wp:attachment":[{"href":"https:\/\/inprotech.es\/en\/wp-json\/wp\/v2\/media?parent=2787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inprotech.es\/en\/wp-json\/wp\/v2\/categories?post=2787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inprotech.es\/en\/wp-json\/wp\/v2\/tags?post=2787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}