{"id":25060265,"url":"https://github.com/42ways/onion-architecture-blueprint","last_synced_at":"2025-04-14T14:30:51.442Z","repository":{"id":71678083,"uuid":"465018098","full_name":"42ways/onion-architecture-blueprint","owner":"42ways","description":"Implementation of the so called \"Onion Architecture\" in plain Java","archived":false,"fork":false,"pushed_at":"2022-04-22T11:24:23.000Z","size":2476,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T03:24:42.692Z","etag":null,"topics":["blueprint","example-code","java","onion","onion-architecture","software-architecture"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/42ways.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-01T18:52:12.000Z","updated_at":"2024-12-03T10:07:30.000Z","dependencies_parsed_at":"2023-07-11T11:02:52.007Z","dependency_job_id":null,"html_url":"https://github.com/42ways/onion-architecture-blueprint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42ways%2Fonion-architecture-blueprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42ways%2Fonion-architecture-blueprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42ways%2Fonion-architecture-blueprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42ways%2Fonion-architecture-blueprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/42ways","download_url":"https://codeload.github.com/42ways/onion-architecture-blueprint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248897008,"owners_count":21179524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blueprint","example-code","java","onion","onion-architecture","software-architecture"],"created_at":"2025-02-06T15:57:36.867Z","updated_at":"2025-04-14T14:30:51.425Z","avatar_url":"https://github.com/42ways.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI build](https://github.com/42ways/onion-architecture-blueprint/actions/workflows/gradle.yml/badge.svg)](https://github.com/42ways/onion-architecture-blueprint/actions/workflows/gradle.yml)\n\n# Onion Architecture Blueprint\n\nThis project is a blueprint for the so-called \"Onion Architecture\", which is a very popular\narchitectural pattern for domain driven design (DDD).\n\nThe basic ideas were published as a\n[series of Blog Posts](https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1/) by\n[Jeffrey Palermo](https://jeffreypalermo.com/).\n\nThis blueprint implementation for an onion architecture started as a playground with some experiments in\nJava Software Architecture Patterns in general, esp. to get a feeling for advantages and disadvantages\nof major Onion Architecture and Clean Architecture principles.\n\nTo show the relevant patterns, the project has as few as possible dependencies.\nThe implemented functions and use cases are kept very simple for the same reason.\n\nTo make the code dependencies explicit, the project is split up into several\nJava modules with restricted access between the modules.\nReal live projects would probably separate these modules into different repositories and/or\nintroduce an even further separation into packages, modules and source code repositories.\n\nThe following diagrams visualize the actual component dependencies of this project based on the implemented\njava modules in comparison to the \"pure\" onion diagram that can be found in most articles and books\nabout this architectural pattern.\n\n![Onion Architecture Module Dependencies](modules.png)\n![Onion Architecture Diagram](ONION-architecture-10000ft.png)\n\n## Build\n\n### Gradle build\n\nThe project comes with gradle build files, including the project module structure and dependencies as well as\nthe external dependencies. See `gradle.settings` in the root directory and `gradle.build` in the modules.\n\nYou can use Gradle via the included `gradlew` (Posix) or `gradlew.bat` (Windows) script without installing Gradle first, e.g.\n\n```gradlew build```\n\nSee the [official Gradle documentation](https://docs.gradle.org/current/userguide/userguide.html) for further info.\n\n### IntelliJ IDE\n\nThe project was written using IntelliJ IDEA, but the build, esp. the dependencies, is based on `gradle`\n(and Java Modules).\nTherefore the `.idea/` folder is excluded from `git`.\n\nYou can open the project as Gradle project with IntelliJ (and probably any other IDE such as Eclipse), and\nall settings should be correct. Please beware to use the gradle tasks and environment for the run configurations\nas well.\n\n## Dependencies and 3rd party tools\n\nAll dependencies are specified in the gradle configuration and build files.\nPlease refer to this actual source of truth regarding the current dependencies,\nsince this README might be out of date.\n\n### Domain functionality\n\nOur example domains are simplified insurance contracts and people with addresses and bank accounts.\n\nFor the later we use the library [iban4j.org](https://github.com/arturmkrtchyan/iban4j)\nto validate and create iban and bic objects.\n\n### Annotations and libraries\n\nThe project uses JPA for persistence (only in the infrastructure layer),\nin the implementation variant [Hibernate](https://hibernate.org/).\n\nIn order to get rid of some shortages of the Java language (especially the noisiness),\nwe also added [Lombok](https://projectlombok.org/) and [Google Guava](https://github.com/google/guava) to the mix.\n\n### QA and documentation tools\n\nThe project uses several tools for QA and documentation, so there are dependencies to\n\n* [JUnit Jupiter](https://junit.org/junit5/) (aka JUnit5), the standard testing framework for Java\n* [JaCoCo](https://www.jacoco.org/), code coverage analysis\n* [SpotBugs](https://spotbugs.github.io/), the successor of FindBugs\n* [ArchiDoc](https://github.com/wilmerkrisp/archidoc), the Gradle wrapper for [Classgraph](https://github.com/classgraph/classgraph) \n\n## Usage\n\nThe module `demo` includes some demo programs that are available as Gradle tasks `runEnumDemo`,\n`runPersonDemo` and `runContractDemo`.\n\nThe demo programs use a H2 database configured to use file based storage in `demo/.h2` (see configuration file\n`infrastructure/src/main/resources/hibernate.cfg.xml`).\n\n## Caveats\n\nThis project is just a playground for different aspects of Domain Driven Design (DDD),\nOnion Architecture and Software-Architecture / Software-Design in general.\n\nMany of the concepts, patterns and coding found in this implementation are more or less just\nattempts to evaluate ideas and/or compare different approaches for several aspects.\n\nTherefore, the project as a whole may seem inconsistent, premature or even plain wrong.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42ways%2Fonion-architecture-blueprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F42ways%2Fonion-architecture-blueprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42ways%2Fonion-architecture-blueprint/lists"}