Hexagonal architecture (software): Difference between revisions

Content deleted Content added
Cth027 (talk | contribs)
Cth027 (talk | contribs)
m Variants: Typo
Line 25:
 
== Variants ==
The onion architecture proposed by JeffryJeffrey Palermo in 2008 is similar to the hexagonal architecture: it also externalizes the infrastructure with proper interfaces to ensure loose coupling between the application and the database.<ref>{{Cite web|url=https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1/|title=The Onion Architecture : part 1|last=Jeffrey|first=Palermo|date=2008-07-29|website=Programming with Palermo|language=en-US|archive-url=|archive-date=|dead-url=|access-date=2019-08-12}}</ref> It decomposes further the application core into several concentric rings using [[inversion of control]].<ref>{{Cite book|url=https://www.worldcat.org/oclc/937787252|title=Learning NHibernate 4 : explore the full potential of NHibernate to build robust data access code|last=Chatekar, Suhas,|first=|publisher=|year=|isbn=978-1-78439-206-2|___location=Birmingham, UK|pages=249-250|oclc=937787252}}</ref>
 
The clean architecture proposed by [[Robert C. Martin]] in 2012 combines the principles of the hexagonal architecture, the onion architecture and several other variants; It provides additional levels of detail of the component, which are presented as concentric rings. It isolates adapters and interfaces (user interface, databases, external systems, devices) in the outer rings of the architecture and leaves the inner rings for [[use case]]s and [[Entity class|entities]]<ref>{{Cite web|url=https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html|title=The Clean architecture {{!}} Clean Coder Blog|last=Martin|first=Robert, C.|date=2012-08-12|website=blog.cleancoder.com|archive-url=|archive-date=|dead-url=|access-date=2019-08-12}}</ref><sup>,</sup>.<ref>{{Cite book|url=https://www.worldcat.org/oclc/1004983973|title=Clean architecture : a craftsman's guide to software structure and design|last=Martin, Robert C.,|isbn=978-0-13-449416-6|___location=London, England|oclc=1004983973}}</ref> The clean architecture uses the principle of [[Dependency inversion principle|dependency inversion]] with the strict rule that dependencies shall only exist between an outer ring to an inner ring and never the contrary.