From 4771e4b6649b828681a26fccc3434699a76daf55 Mon Sep 17 00:00:00 2001 From: Oliver Drotbohm Date: Fri, 26 Nov 2021 20:04:51 +0100 Subject: [PATCH 1/3] #67 - Prepare next development iteration. --- jmolecules-architecture/jmolecules-cqrs-architecture/pom.xml | 2 +- .../jmolecules-layered-architecture/pom.xml | 2 +- jmolecules-architecture/jmolecules-onion-architecture/pom.xml | 2 +- jmolecules-architecture/pom.xml | 2 +- jmolecules-ddd/pom.xml | 2 +- jmolecules-events/pom.xml | 2 +- pom.xml | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/jmolecules-architecture/jmolecules-cqrs-architecture/pom.xml b/jmolecules-architecture/jmolecules-cqrs-architecture/pom.xml index 8fce675..0dab55f 100644 --- a/jmolecules-architecture/jmolecules-cqrs-architecture/pom.xml +++ b/jmolecules-architecture/jmolecules-cqrs-architecture/pom.xml @@ -6,7 +6,7 @@ jmolecules-architecture org.jmolecules - 1.4.0 + 1.5.0-SNAPSHOT jmolecules-cqrs-architecture diff --git a/jmolecules-architecture/jmolecules-layered-architecture/pom.xml b/jmolecules-architecture/jmolecules-layered-architecture/pom.xml index 63ddc51..1057a4d 100644 --- a/jmolecules-architecture/jmolecules-layered-architecture/pom.xml +++ b/jmolecules-architecture/jmolecules-layered-architecture/pom.xml @@ -6,7 +6,7 @@ jmolecules-architecture org.jmolecules - 1.4.0 + 1.5.0-SNAPSHOT jmolecules-layered-architecture diff --git a/jmolecules-architecture/jmolecules-onion-architecture/pom.xml b/jmolecules-architecture/jmolecules-onion-architecture/pom.xml index d17283d..3ec7cf4 100644 --- a/jmolecules-architecture/jmolecules-onion-architecture/pom.xml +++ b/jmolecules-architecture/jmolecules-onion-architecture/pom.xml @@ -6,7 +6,7 @@ jmolecules-architecture org.jmolecules - 1.4.0 + 1.5.0-SNAPSHOT jmolecules-onion-architecture diff --git a/jmolecules-architecture/pom.xml b/jmolecules-architecture/pom.xml index 2b15195..772736c 100644 --- a/jmolecules-architecture/pom.xml +++ b/jmolecules-architecture/pom.xml @@ -6,7 +6,7 @@ jmolecules org.jmolecules - 1.4.0 + 1.5.0-SNAPSHOT jmolecules-architecture diff --git a/jmolecules-ddd/pom.xml b/jmolecules-ddd/pom.xml index 1b5554b..ecc83a4 100644 --- a/jmolecules-ddd/pom.xml +++ b/jmolecules-ddd/pom.xml @@ -5,7 +5,7 @@ org.jmolecules jmolecules - 1.4.0 + 1.5.0-SNAPSHOT jmolecules-ddd diff --git a/jmolecules-events/pom.xml b/jmolecules-events/pom.xml index 7e505d5..4c00234 100644 --- a/jmolecules-events/pom.xml +++ b/jmolecules-events/pom.xml @@ -5,7 +5,7 @@ org.jmolecules jmolecules - 1.4.0 + 1.5.0-SNAPSHOT jmolecules-events diff --git a/pom.xml b/pom.xml index dd3c399..98e3ae6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.jmolecules jmolecules - 1.4.0 + 1.5.0-SNAPSHOT pom jMolecules @@ -222,7 +222,7 @@ https://github.com/xmolecules/jmolecules scm:git:https://github.com/xmolecules/jmolecules scm:git:ssh://git@github.com/xmolecules/jmolecules.git - 1.4.0 + HEAD From 87e5388b6e33fd9fe459737400ce30cec0d57d60 Mon Sep 17 00:00:00 2001 From: Oliver Drotbohm Date: Fri, 26 Nov 2021 20:17:07 +0100 Subject: [PATCH 2/3] GH-67 - Update readme after release. --- readme.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.adoc b/readme.adoc index ff4c0cb..7194a55 100644 --- a/readme.adoc +++ b/readme.adoc @@ -155,7 +155,7 @@ Release binaries are available from the Maven central repository. org.jmolecules jmolecules-ddd - 1.3.0 + 1.4.0 ---- @@ -167,7 +167,7 @@ repositories { mavenCentral() } dependencies { - implementation("org.jmolecules:jmolecules-ddd:1.3.0") + implementation("org.jmolecules:jmolecules-ddd:1.4.0") } ---- From 10eaeff0b88a185f4c00bb39b375d625208ef7c7 Mon Sep 17 00:00:00 2001 From: Mahatma_Fatal_Error Date: Mon, 6 Dec 2021 21:58:17 +0100 Subject: [PATCH 3/3] adds annotations for hexagonal architecture --- .../onion/hexagonal/CoreLogic.java | 35 +++++++++++++++++++ .../onion/hexagonal/InputPort.java | 34 ++++++++++++++++++ .../onion/hexagonal/OutputPort.java | 33 +++++++++++++++++ .../onion/hexagonal/PrimaryAdapter.java | 34 ++++++++++++++++++ .../onion/hexagonal/SecondaryAdapter.java | 35 +++++++++++++++++++ 5 files changed, 171 insertions(+) create mode 100644 jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/CoreLogic.java create mode 100644 jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/InputPort.java create mode 100644 jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/OutputPort.java create mode 100644 jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/PrimaryAdapter.java create mode 100644 jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/SecondaryAdapter.java diff --git a/jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/CoreLogic.java b/jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/CoreLogic.java new file mode 100644 index 0000000..b99c598 --- /dev/null +++ b/jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/CoreLogic.java @@ -0,0 +1,35 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jmolecules.architecture.onion.hexagonal; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Identifies the {@link CoreLogic} in an hexagonal architecture. + * The core logic, or business logic, of an application consists of the algorithms that are essential to its purpose. + * They implement the use cases that are the heart of the application. + * All dependencies are in the direction of the core logic. The core itself does not depend on anything. + * + */ +@Retention(RetentionPolicy.CLASS) +@Target({ ElementType.PACKAGE, ElementType.TYPE }) +@Documented +public @interface CoreLogic { +} diff --git a/jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/InputPort.java b/jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/InputPort.java new file mode 100644 index 0000000..1dbb3e9 --- /dev/null +++ b/jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/InputPort.java @@ -0,0 +1,34 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jmolecules.architecture.onion.hexagonal; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Identifies the {@link InputPort} in an hexagonal architecture. + * An inbound port defines the exposure of the core’s functionality. + * These interfaces define how the Core Business Logic can be used. This is the only part of the core exposed to the outside world. + * + */ +@Retention(RetentionPolicy.CLASS) +@Target({ ElementType.PACKAGE, ElementType.TYPE }) +@Documented +public @interface InputPort { +} diff --git a/jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/OutputPort.java b/jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/OutputPort.java new file mode 100644 index 0000000..46e1440 --- /dev/null +++ b/jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/OutputPort.java @@ -0,0 +1,33 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jmolecules.architecture.onion.hexagonal; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Identifies the {@link OutputPort} in an hexagonal architecture. + * An outbound port define the core’s view of the outside world. This are the interface the core need to communicate with the outside world. + * + */ +@Retention(RetentionPolicy.CLASS) +@Target({ ElementType.PACKAGE, ElementType.TYPE }) +@Documented +public @interface OutputPort { +} diff --git a/jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/PrimaryAdapter.java b/jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/PrimaryAdapter.java new file mode 100644 index 0000000..6bd0ac6 --- /dev/null +++ b/jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/PrimaryAdapter.java @@ -0,0 +1,34 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jmolecules.architecture.onion.hexagonal; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Identifies the {@link PrimaryAdapter} in an hexagonal architecture. + * It is also known as Driving adapters because they drive the application, and start actions in the core application. + * These adapters can use the inbound ports (interfaces) provided by the core application. The controllers then depends on these interfaces of the core business logic. + * + */ +@Retention(RetentionPolicy.CLASS) +@Target({ ElementType.PACKAGE, ElementType.TYPE }) +@Documented +public @interface PrimaryAdapter { +} diff --git a/jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/SecondaryAdapter.java b/jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/SecondaryAdapter.java new file mode 100644 index 0000000..85a5069 --- /dev/null +++ b/jmolecules-architecture/jmolecules-onion-architecture/src/main/java/org/jmolecules/architecture/onion/hexagonal/SecondaryAdapter.java @@ -0,0 +1,35 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jmolecules.architecture.onion.hexagonal; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Identifies the {@link SecondaryAdapter} in an hexagonal architecture. + * It is also known as Driven Adapters and represents the connection to your back-end (databases, external libs, network communication, etc. + * These adapters react to actions iniated by the primary adapters. The secondary adapters are implementations of the outbound port. + * Which in return depend on interfaces of these external libraries and tools to transform them, so the core application can use these without being coupled to them. + * + */ +@Retention(RetentionPolicy.CLASS) +@Target({ ElementType.PACKAGE, ElementType.TYPE }) +@Documented +public @interface SecondaryAdapter { +}