Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

An example of implementing hexagonal design in a spring-boot application (A work in progress)

Notifications You must be signed in to change notification settings

loile/spring-hexagonal-example

Open more actions menu
 
 

Repository files navigation

Hexagonal (Port and Adapter) Example

A spring-boot based example of hexagonal design (also known as the ports and adapters design).

Through the use of ports, contracts between the various modules can be set up, allowing for the modules to be easily replaced with other implementations. The only condition; that the module conforms to the contract specified.

Thus by having a hexagonal design, the current database adapter module; which is a simple in-memory implementation can be swapped out for a JPA repository or a flat file or something else and as long as it conforms to the contract (aka port) no other module (especially the domain module) needs to know or care.

Similarly, the name verifier adapter can be swapped out for a real implementation that would communicate with a third party application without the rest of our application ever knowing. Again as long as the current implementation conforms to the contract (in this case the NameVerifierService) no one will ever know the difference.

Also, the rest api adapter (which as the name implies uses HTTP REST) could be replaced by a SOAP based api and again the domain (and other modules) would not know nor need to care as long as the new api passed along the expected objects as specified in the ports (AddUserService and GetUserService).

Getting Started

    git clone https://github.com/gshaw-pivotal/spring-hexagonal-example.git

Resources on Hexagonal / Ports and Adapters

The following are some resources that explain the hexagonal design / pattern

About

An example of implementing hexagonal design in a spring-boot application (A work in progress)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 74.7%
  • Shell 14.3%
  • Batchfile 11.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.