Hexagonal architecture (software): Difference between revisions

Content deleted Content added
Monkbot (talk | contribs)
m Task 16: replaced (1×) / removed (3×) deprecated |dead-url= and |deadurl= with |url-status=;
No edit summary
Line 2:
 
== Origin ==
The hexagonal architecture was invented by [[Alistair Cockburn]] in an attempt to avoid known structural pitfalls in [[Object-oriented analysis and design|object -oriented software design]], such as undesired dependencies between [[Layer (object-oriented design)|layers]] and contamination of [[user interface]] code with [[business logic]], and published in 2005.<ref>{{Cite web|url=https://www.infoq.com/news/2014/10/exploring-hexagonal-architecture/|title=Exploring the Hexagonal Architecture|last=Stenberg|first=Jan|date=2014-10-31|website=InfoQ|access-date=2019-08-12}}</ref>
 
The term "hexagonal" comes from the graphical conventions that shows the application component like a [[hexagon]]al cell. The purpose was not to suggest that there would be six borders/ports, but to leave enough space to represent the different interfaces needed between the component and the external world.<ref name=":0" />
Line 10:
The hexagonal architecture divides a system into several loosely-coupled interchangeable components, such as the application core, the database, the user interface, test scripts and interfaces with other systems. This approach is an alternative to the traditional layered architecture.
 
Each component is connected to the others through a number of exposed "ports". Communication through these ports follow a given protocol depending on their purpose. Ports and protocols define an abstract [[Application programming interface|API]] that can be implemented by any suitable technical means (e.g. [[method invocation]] in an [[Object-oriented programming|object -oriented language]], [[remote procedure call]]s, or [[Web service|web-services]]s).
 
The granularity of the ports and their number is not constrainted:
Line 17:
* in an extreme case, there could be a different port for every [[use case]], if needed.
 
[[Adapter pattern|Adapters]] are the glue between components and with the outside world. They tailor the exchanges between the external world and the ports that represent the requirements of the inside of the application component. There can be several adapters for one port, for example if data can be provided by a user through a GUI or a command -line interface, by an automated data source, or by test scripts.
 
== Usage, criticism and evolution ==