diff --git a/ddd-modules/README.md b/ddd-contexts/README.md similarity index 100% rename from ddd-modules/README.md rename to ddd-contexts/README.md diff --git a/ddd-modules/infrastructure/pom.xml b/ddd-contexts/infrastructure/pom.xml similarity index 80% rename from ddd-modules/infrastructure/pom.xml rename to ddd-contexts/infrastructure/pom.xml index 232e5ff4b4..6107991ceb 100644 --- a/ddd-modules/infrastructure/pom.xml +++ b/ddd-contexts/infrastructure/pom.xml @@ -3,31 +3,31 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.dddmodules.infrastructure + com.baeldung.dddcontexts.infrastructure infrastructure 1.0 jar - com.baeldung.dddmodules - ddd-modules + com.baeldung.dddcontexts + ddd-contexts 1.0 ../ - com.baeldung.dddmodules.shippingcontext + com.baeldung.dddcontexts.shippingcontext shippingcontext ${appmodules.version} - com.baeldung.dddmodules.ordercontext + com.baeldung.dddcontexts.ordercontext ordercontext ${appmodules.version} - com.baeldung.dddmodules.sharedkernel + com.baeldung.dddcontexts.sharedkernel sharedkernel ${appmodules.version} diff --git a/ddd-modules/infrastructure/src/main/java/com/baeldung/dddmodules/infrastructure/db/InMemoryOrderStore.java b/ddd-contexts/infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/db/InMemoryOrderStore.java similarity index 85% rename from ddd-modules/infrastructure/src/main/java/com/baeldung/dddmodules/infrastructure/db/InMemoryOrderStore.java rename to ddd-contexts/infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/db/InMemoryOrderStore.java index 13deb2471e..8424afff79 100644 --- a/ddd-modules/infrastructure/src/main/java/com/baeldung/dddmodules/infrastructure/db/InMemoryOrderStore.java +++ b/ddd-contexts/infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/db/InMemoryOrderStore.java @@ -1,10 +1,10 @@ -package com.baeldung.dddmodules.infrastructure.db; +package com.baeldung.dddcontexts.infrastructure.db; -import com.baeldung.dddmodules.ordercontext.model.CustomerOrder; -import com.baeldung.dddmodules.ordercontext.repository.CustomerOrderRepository; -import com.baeldung.dddmodules.shippingcontext.model.PackageItem; -import com.baeldung.dddmodules.shippingcontext.model.ShippableOrder; -import com.baeldung.dddmodules.shippingcontext.repository.ShippingOrderRepository; +import com.baeldung.dddcontexts.ordercontext.model.CustomerOrder; +import com.baeldung.dddcontexts.ordercontext.repository.CustomerOrderRepository; +import com.baeldung.dddcontexts.shippingcontext.model.PackageItem; +import com.baeldung.dddcontexts.shippingcontext.model.ShippableOrder; +import com.baeldung.dddcontexts.shippingcontext.repository.ShippingOrderRepository; import java.util.HashMap; import java.util.List; diff --git a/ddd-modules/infrastructure/src/main/java/com/baeldung/dddmodules/infrastructure/events/SimpleEventBus.java b/ddd-contexts/infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/events/SimpleEventBus.java similarity index 82% rename from ddd-modules/infrastructure/src/main/java/com/baeldung/dddmodules/infrastructure/events/SimpleEventBus.java rename to ddd-contexts/infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/events/SimpleEventBus.java index 6aea7ff6e9..1cbcf13749 100644 --- a/ddd-modules/infrastructure/src/main/java/com/baeldung/dddmodules/infrastructure/events/SimpleEventBus.java +++ b/ddd-contexts/infrastructure/src/main/java/com/baeldung/dddcontexts/infrastructure/events/SimpleEventBus.java @@ -1,8 +1,8 @@ -package com.baeldung.dddmodules.infrastructure.events; +package com.baeldung.dddcontexts.infrastructure.events; -import com.baeldung.dddmodules.sharedkernel.events.ApplicationEvent; -import com.baeldung.dddmodules.sharedkernel.events.EventBus; -import com.baeldung.dddmodules.sharedkernel.events.EventSubscriber; +import com.baeldung.dddcontexts.sharedkernel.events.ApplicationEvent; +import com.baeldung.dddcontexts.sharedkernel.events.EventBus; +import com.baeldung.dddcontexts.sharedkernel.events.EventSubscriber; import java.util.Map; import java.util.Set; diff --git a/ddd-contexts/infrastructure/src/main/java/module-info.java b/ddd-contexts/infrastructure/src/main/java/module-info.java new file mode 100644 index 0000000000..1387de16c2 --- /dev/null +++ b/ddd-contexts/infrastructure/src/main/java/module-info.java @@ -0,0 +1,14 @@ +import com.baeldung.dddcontexts.infrastructure.db.InMemoryOrderStore; +import com.baeldung.dddcontexts.infrastructure.events.SimpleEventBus; + +module com.baeldung.dddcontexts.infrastructure { + requires transitive com.baeldung.dddcontexts.sharedkernel; + requires transitive com.baeldung.dddcontexts.ordercontext; + requires transitive com.baeldung.dddcontexts.shippingcontext; + provides com.baeldung.dddcontexts.sharedkernel.events.EventBus + with SimpleEventBus; + provides com.baeldung.dddcontexts.ordercontext.repository.CustomerOrderRepository + with InMemoryOrderStore; + provides com.baeldung.dddcontexts.shippingcontext.repository.ShippingOrderRepository + with InMemoryOrderStore; +} diff --git a/ddd-modules/mainapp/pom.xml b/ddd-contexts/mainapp/pom.xml similarity index 87% rename from ddd-modules/mainapp/pom.xml rename to ddd-contexts/mainapp/pom.xml index a2d3b8f3ea..8046ae4e7d 100644 --- a/ddd-modules/mainapp/pom.xml +++ b/ddd-contexts/mainapp/pom.xml @@ -3,21 +3,21 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.dddmodules.mainapp + com.baeldung.dddcontexts.mainapp mainapp 1.0 jar - com.baeldung.dddmodules - ddd-modules + com.baeldung.dddcontexts + ddd-contexts 1.0 ../ - com.baeldung.dddmodules.infrastructure + com.baeldung.dddcontexts.infrastructure infrastructure ${appmodules.version} diff --git a/ddd-modules/mainapp/src/main/java/com/baeldung/dddmodules/mainapp/Application.java b/ddd-contexts/mainapp/src/main/java/com/baeldung/dddcontexts/mainapp/Application.java similarity index 80% rename from ddd-modules/mainapp/src/main/java/com/baeldung/dddmodules/mainapp/Application.java rename to ddd-contexts/mainapp/src/main/java/com/baeldung/dddcontexts/mainapp/Application.java index 05e27abe30..ff866e49dd 100644 --- a/ddd-modules/mainapp/src/main/java/com/baeldung/dddmodules/mainapp/Application.java +++ b/ddd-contexts/mainapp/src/main/java/com/baeldung/dddcontexts/mainapp/Application.java @@ -1,12 +1,12 @@ -package com.baeldung.dddmodules.mainapp; +package com.baeldung.dddcontexts.mainapp; -import com.baeldung.dddmodules.ordercontext.model.CustomerOrder; -import com.baeldung.dddmodules.ordercontext.model.OrderItem; -import com.baeldung.dddmodules.ordercontext.repository.CustomerOrderRepository; -import com.baeldung.dddmodules.ordercontext.service.OrderService; -import com.baeldung.dddmodules.sharedkernel.events.EventBus; -import com.baeldung.dddmodules.shippingcontext.repository.ShippingOrderRepository; -import com.baeldung.dddmodules.shippingcontext.service.ShippingService; +import com.baeldung.dddcontexts.ordercontext.model.CustomerOrder; +import com.baeldung.dddcontexts.ordercontext.model.OrderItem; +import com.baeldung.dddcontexts.ordercontext.repository.CustomerOrderRepository; +import com.baeldung.dddcontexts.ordercontext.service.OrderService; +import com.baeldung.dddcontexts.sharedkernel.events.EventBus; +import com.baeldung.dddcontexts.shippingcontext.repository.ShippingOrderRepository; +import com.baeldung.dddcontexts.shippingcontext.service.ShippingService; import java.util.*; diff --git a/ddd-contexts/mainapp/src/main/java/module-info.java b/ddd-contexts/mainapp/src/main/java/module-info.java new file mode 100644 index 0000000000..b71e474111 --- /dev/null +++ b/ddd-contexts/mainapp/src/main/java/module-info.java @@ -0,0 +1,8 @@ +module com.baeldung.dddcontexts.mainapp { + uses com.baeldung.dddcontexts.sharedkernel.events.EventBus; + uses com.baeldung.dddcontexts.ordercontext.service.OrderService; + uses com.baeldung.dddcontexts.ordercontext.repository.CustomerOrderRepository; + uses com.baeldung.dddcontexts.shippingcontext.repository.ShippingOrderRepository; + uses com.baeldung.dddcontexts.shippingcontext.service.ShippingService; + requires transitive com.baeldung.dddcontexts.infrastructure; +} \ No newline at end of file diff --git a/ddd-modules/ordercontext/pom.xml b/ddd-contexts/ordercontext/pom.xml similarity index 84% rename from ddd-modules/ordercontext/pom.xml rename to ddd-contexts/ordercontext/pom.xml index eaf44badd3..e29f109b71 100644 --- a/ddd-modules/ordercontext/pom.xml +++ b/ddd-contexts/ordercontext/pom.xml @@ -3,20 +3,20 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.dddmodules.ordercontext + com.baeldung.dddcontexts.ordercontext ordercontext 1.0 jar - com.baeldung.dddmodules - ddd-modules + com.baeldung.dddcontexts + ddd-contexts 1.0 - com.baeldung.dddmodules.sharedkernel + com.baeldung.dddcontexts.sharedkernel sharedkernel ${appmodules.version} diff --git a/ddd-modules/ordercontext/src/main/java/com/baeldung/dddmodules/ordercontext/model/CustomerOrder.java b/ddd-contexts/ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/CustomerOrder.java similarity index 95% rename from ddd-modules/ordercontext/src/main/java/com/baeldung/dddmodules/ordercontext/model/CustomerOrder.java rename to ddd-contexts/ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/CustomerOrder.java index ee87de56bd..8a69e8b805 100644 --- a/ddd-modules/ordercontext/src/main/java/com/baeldung/dddmodules/ordercontext/model/CustomerOrder.java +++ b/ddd-contexts/ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/CustomerOrder.java @@ -1,4 +1,4 @@ -package com.baeldung.dddmodules.ordercontext.model; +package com.baeldung.dddcontexts.ordercontext.model; import java.util.List; diff --git a/ddd-modules/ordercontext/src/main/java/com/baeldung/dddmodules/ordercontext/model/OrderItem.java b/ddd-contexts/ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/OrderItem.java similarity index 95% rename from ddd-modules/ordercontext/src/main/java/com/baeldung/dddmodules/ordercontext/model/OrderItem.java rename to ddd-contexts/ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/OrderItem.java index aaad0777e4..87b8fea260 100644 --- a/ddd-modules/ordercontext/src/main/java/com/baeldung/dddmodules/ordercontext/model/OrderItem.java +++ b/ddd-contexts/ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/model/OrderItem.java @@ -1,4 +1,4 @@ -package com.baeldung.dddmodules.ordercontext.model; +package com.baeldung.dddcontexts.ordercontext.model; public class OrderItem { private int productId; diff --git a/ddd-contexts/ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/repository/CustomerOrderRepository.java b/ddd-contexts/ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/repository/CustomerOrderRepository.java new file mode 100644 index 0000000000..15d1e70981 --- /dev/null +++ b/ddd-contexts/ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/repository/CustomerOrderRepository.java @@ -0,0 +1,7 @@ +package com.baeldung.dddcontexts.ordercontext.repository; + +import com.baeldung.dddcontexts.ordercontext.model.CustomerOrder; + +public interface CustomerOrderRepository { + void saveCustomerOrder(CustomerOrder order); +} diff --git a/ddd-modules/ordercontext/src/main/java/com/baeldung/dddmodules/ordercontext/service/CustomerOrderService.java b/ddd-contexts/ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/CustomerOrderService.java similarity index 76% rename from ddd-modules/ordercontext/src/main/java/com/baeldung/dddmodules/ordercontext/service/CustomerOrderService.java rename to ddd-contexts/ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/CustomerOrderService.java index b9d26e6212..c017f36ca5 100644 --- a/ddd-modules/ordercontext/src/main/java/com/baeldung/dddmodules/ordercontext/service/CustomerOrderService.java +++ b/ddd-contexts/ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/CustomerOrderService.java @@ -1,9 +1,9 @@ -package com.baeldung.dddmodules.ordercontext.service; +package com.baeldung.dddcontexts.ordercontext.service; -import com.baeldung.dddmodules.ordercontext.model.CustomerOrder; -import com.baeldung.dddmodules.ordercontext.repository.CustomerOrderRepository; -import com.baeldung.dddmodules.sharedkernel.events.ApplicationEvent; -import com.baeldung.dddmodules.sharedkernel.events.EventBus; +import com.baeldung.dddcontexts.ordercontext.model.CustomerOrder; +import com.baeldung.dddcontexts.ordercontext.repository.CustomerOrderRepository; +import com.baeldung.dddcontexts.sharedkernel.events.ApplicationEvent; +import com.baeldung.dddcontexts.sharedkernel.events.EventBus; import java.util.HashMap; import java.util.Map; diff --git a/ddd-contexts/ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/OrderService.java b/ddd-contexts/ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/OrderService.java new file mode 100644 index 0000000000..94e9dcc7fc --- /dev/null +++ b/ddd-contexts/ordercontext/src/main/java/com/baeldung/dddcontexts/ordercontext/service/OrderService.java @@ -0,0 +1,11 @@ +package com.baeldung.dddcontexts.ordercontext.service; + +import com.baeldung.dddcontexts.ordercontext.model.CustomerOrder; +import com.baeldung.dddcontexts.ordercontext.repository.CustomerOrderRepository; +import com.baeldung.dddcontexts.sharedkernel.service.ApplicationService; + +public interface OrderService extends ApplicationService { + void placeOrder(CustomerOrder order); + + void setOrderRepository(CustomerOrderRepository orderRepository); +} diff --git a/ddd-contexts/ordercontext/src/main/java/module-info.java b/ddd-contexts/ordercontext/src/main/java/module-info.java new file mode 100644 index 0000000000..681565ab4d --- /dev/null +++ b/ddd-contexts/ordercontext/src/main/java/module-info.java @@ -0,0 +1,8 @@ +module com.baeldung.dddcontexts.ordercontext { + requires com.baeldung.dddcontexts.sharedkernel; + exports com.baeldung.dddcontexts.ordercontext.service; + exports com.baeldung.dddcontexts.ordercontext.model; + exports com.baeldung.dddcontexts.ordercontext.repository; + provides com.baeldung.dddcontexts.ordercontext.service.OrderService + with com.baeldung.dddcontexts.ordercontext.service.CustomerOrderService; +} \ No newline at end of file diff --git a/ddd-modules/pom.xml b/ddd-contexts/pom.xml similarity index 95% rename from ddd-modules/pom.xml rename to ddd-contexts/pom.xml index d2932ee515..1a764a65b9 100644 --- a/ddd-modules/pom.xml +++ b/ddd-contexts/pom.xml @@ -3,10 +3,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.dddmodules - ddd-modules + com.baeldung.dddcontexts + ddd-contexts 1.0 - ddd-modules + ddd-contexts pom diff --git a/ddd-modules/sharedkernel/pom.xml b/ddd-contexts/sharedkernel/pom.xml similarity index 86% rename from ddd-modules/sharedkernel/pom.xml rename to ddd-contexts/sharedkernel/pom.xml index 3966e1c26e..5d31973c92 100644 --- a/ddd-modules/sharedkernel/pom.xml +++ b/ddd-contexts/sharedkernel/pom.xml @@ -3,14 +3,14 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.dddmodules.sharedkernel + com.baeldung.dddcontexts.sharedkernel sharedkernel 1.0 jar - com.baeldung.dddmodules - ddd-modules + com.baeldung.dddcontexts + ddd-contexts 1.0 diff --git a/ddd-modules/sharedkernel/src/main/java/com/baeldung/dddmodules/sharedkernel/events/ApplicationEvent.java b/ddd-contexts/sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/ApplicationEvent.java similarity index 88% rename from ddd-modules/sharedkernel/src/main/java/com/baeldung/dddmodules/sharedkernel/events/ApplicationEvent.java rename to ddd-contexts/sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/ApplicationEvent.java index e3c3ebaf0e..7db89e36e0 100644 --- a/ddd-modules/sharedkernel/src/main/java/com/baeldung/dddmodules/sharedkernel/events/ApplicationEvent.java +++ b/ddd-contexts/sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/ApplicationEvent.java @@ -1,4 +1,4 @@ -package com.baeldung.dddmodules.sharedkernel.events; +package com.baeldung.dddcontexts.sharedkernel.events; import java.util.Map; diff --git a/ddd-modules/sharedkernel/src/main/java/com/baeldung/dddmodules/sharedkernel/events/EventBus.java b/ddd-contexts/sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventBus.java similarity index 83% rename from ddd-modules/sharedkernel/src/main/java/com/baeldung/dddmodules/sharedkernel/events/EventBus.java rename to ddd-contexts/sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventBus.java index b128b959e9..be95de674d 100644 --- a/ddd-modules/sharedkernel/src/main/java/com/baeldung/dddmodules/sharedkernel/events/EventBus.java +++ b/ddd-contexts/sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventBus.java @@ -1,4 +1,4 @@ -package com.baeldung.dddmodules.sharedkernel.events; +package com.baeldung.dddcontexts.sharedkernel.events; public interface EventBus { void publish(E event); diff --git a/ddd-modules/sharedkernel/src/main/java/com/baeldung/dddmodules/sharedkernel/events/EventSubscriber.java b/ddd-contexts/sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventSubscriber.java similarity index 63% rename from ddd-modules/sharedkernel/src/main/java/com/baeldung/dddmodules/sharedkernel/events/EventSubscriber.java rename to ddd-contexts/sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventSubscriber.java index 0d6d48cc33..f941514024 100644 --- a/ddd-modules/sharedkernel/src/main/java/com/baeldung/dddmodules/sharedkernel/events/EventSubscriber.java +++ b/ddd-contexts/sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/events/EventSubscriber.java @@ -1,4 +1,4 @@ -package com.baeldung.dddmodules.sharedkernel.events; +package com.baeldung.dddcontexts.sharedkernel.events; public interface EventSubscriber { void onEvent(E event); diff --git a/ddd-modules/sharedkernel/src/main/java/com/baeldung/dddmodules/sharedkernel/service/ApplicationService.java b/ddd-contexts/sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/service/ApplicationService.java similarity index 76% rename from ddd-modules/sharedkernel/src/main/java/com/baeldung/dddmodules/sharedkernel/service/ApplicationService.java rename to ddd-contexts/sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/service/ApplicationService.java index 5ef57ae269..a9f4488d90 100644 --- a/ddd-modules/sharedkernel/src/main/java/com/baeldung/dddmodules/sharedkernel/service/ApplicationService.java +++ b/ddd-contexts/sharedkernel/src/main/java/com/baeldung/dddcontexts/sharedkernel/service/ApplicationService.java @@ -1,8 +1,8 @@ -package com.baeldung.dddmodules.sharedkernel.service; +package com.baeldung.dddcontexts.sharedkernel.service; -import com.baeldung.dddmodules.sharedkernel.events.ApplicationEvent; -import com.baeldung.dddmodules.sharedkernel.events.EventBus; -import com.baeldung.dddmodules.sharedkernel.events.EventSubscriber; +import com.baeldung.dddcontexts.sharedkernel.events.ApplicationEvent; +import com.baeldung.dddcontexts.sharedkernel.events.EventBus; +import com.baeldung.dddcontexts.sharedkernel.events.EventSubscriber; public interface ApplicationService { diff --git a/ddd-contexts/sharedkernel/src/main/java/module-info.java b/ddd-contexts/sharedkernel/src/main/java/module-info.java new file mode 100644 index 0000000000..f093924aed --- /dev/null +++ b/ddd-contexts/sharedkernel/src/main/java/module-info.java @@ -0,0 +1,4 @@ +module com.baeldung.dddcontexts.sharedkernel { + exports com.baeldung.dddcontexts.sharedkernel.events; + exports com.baeldung.dddcontexts.sharedkernel.service; +} diff --git a/ddd-modules/shippingcontext/pom.xml b/ddd-contexts/shippingcontext/pom.xml similarity index 83% rename from ddd-modules/shippingcontext/pom.xml rename to ddd-contexts/shippingcontext/pom.xml index a6e6167b69..2fb9e83645 100644 --- a/ddd-modules/shippingcontext/pom.xml +++ b/ddd-contexts/shippingcontext/pom.xml @@ -3,20 +3,20 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.dddmodules.shippingcontext + com.baeldung.dddcontexts.shippingcontext shippingcontext 1.0 jar - com.baeldung.dddmodules - ddd-modules + com.baeldung.dddcontexts + ddd-contexts 1.0 - com.baeldung.dddmodules.sharedkernel + com.baeldung.dddcontexts.sharedkernel sharedkernel ${appmodules.version} diff --git a/ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/model/PackageItem.java b/ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/PackageItem.java similarity index 93% rename from ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/model/PackageItem.java rename to ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/PackageItem.java index ed09a0f2a2..0e4da42cec 100644 --- a/ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/model/PackageItem.java +++ b/ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/PackageItem.java @@ -1,4 +1,4 @@ -package com.baeldung.dddmodules.shippingcontext.model; +package com.baeldung.dddcontexts.shippingcontext.model; public class PackageItem { private int productId; diff --git a/ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/model/Parcel.java b/ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/Parcel.java similarity index 95% rename from ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/model/Parcel.java rename to ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/Parcel.java index 70c4f06ac6..ee24818fb0 100644 --- a/ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/model/Parcel.java +++ b/ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/Parcel.java @@ -1,4 +1,4 @@ -package com.baeldung.dddmodules.shippingcontext.model; +package com.baeldung.dddcontexts.shippingcontext.model; import java.util.List; diff --git a/ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/model/ShippableOrder.java b/ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/ShippableOrder.java similarity index 93% rename from ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/model/ShippableOrder.java rename to ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/ShippableOrder.java index afeea2f472..97daaf681e 100644 --- a/ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/model/ShippableOrder.java +++ b/ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/model/ShippableOrder.java @@ -1,4 +1,4 @@ -package com.baeldung.dddmodules.shippingcontext.model; +package com.baeldung.dddcontexts.shippingcontext.model; import java.util.List; diff --git a/ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/repository/ShippingOrderRepository.java b/ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/repository/ShippingOrderRepository.java similarity index 51% rename from ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/repository/ShippingOrderRepository.java rename to ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/repository/ShippingOrderRepository.java index b1a643f989..ba01d8e39c 100644 --- a/ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/repository/ShippingOrderRepository.java +++ b/ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/repository/ShippingOrderRepository.java @@ -1,6 +1,6 @@ -package com.baeldung.dddmodules.shippingcontext.repository; +package com.baeldung.dddcontexts.shippingcontext.repository; -import com.baeldung.dddmodules.shippingcontext.model.ShippableOrder; +import com.baeldung.dddcontexts.shippingcontext.model.ShippableOrder; import java.util.Optional; diff --git a/ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/service/ParcelShippingService.java b/ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ParcelShippingService.java similarity index 78% rename from ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/service/ParcelShippingService.java rename to ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ParcelShippingService.java index 05f261612e..70c0970e8b 100644 --- a/ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/service/ParcelShippingService.java +++ b/ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ParcelShippingService.java @@ -1,11 +1,11 @@ -package com.baeldung.dddmodules.shippingcontext.service; +package com.baeldung.dddcontexts.shippingcontext.service; -import com.baeldung.dddmodules.sharedkernel.events.ApplicationEvent; -import com.baeldung.dddmodules.sharedkernel.events.EventBus; -import com.baeldung.dddmodules.sharedkernel.events.EventSubscriber; -import com.baeldung.dddmodules.shippingcontext.model.Parcel; -import com.baeldung.dddmodules.shippingcontext.model.ShippableOrder; -import com.baeldung.dddmodules.shippingcontext.repository.ShippingOrderRepository; +import com.baeldung.dddcontexts.sharedkernel.events.ApplicationEvent; +import com.baeldung.dddcontexts.sharedkernel.events.EventBus; +import com.baeldung.dddcontexts.sharedkernel.events.EventSubscriber; +import com.baeldung.dddcontexts.shippingcontext.model.Parcel; +import com.baeldung.dddcontexts.shippingcontext.model.ShippableOrder; +import com.baeldung.dddcontexts.shippingcontext.repository.ShippingOrderRepository; import java.util.HashMap; import java.util.Map; diff --git a/ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/service/ShippingService.java b/ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ShippingService.java similarity index 50% rename from ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/service/ShippingService.java rename to ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ShippingService.java index a2f0095c43..b78a0f9fb2 100644 --- a/ddd-modules/shippingcontext/src/main/java/com/baeldung/dddmodules/shippingcontext/service/ShippingService.java +++ b/ddd-contexts/shippingcontext/src/main/java/com/baeldung/dddcontexts/shippingcontext/service/ShippingService.java @@ -1,8 +1,8 @@ -package com.baeldung.dddmodules.shippingcontext.service; +package com.baeldung.dddcontexts.shippingcontext.service; -import com.baeldung.dddmodules.sharedkernel.service.ApplicationService; -import com.baeldung.dddmodules.shippingcontext.model.Parcel; -import com.baeldung.dddmodules.shippingcontext.repository.ShippingOrderRepository; +import com.baeldung.dddcontexts.sharedkernel.service.ApplicationService; +import com.baeldung.dddcontexts.shippingcontext.model.Parcel; +import com.baeldung.dddcontexts.shippingcontext.repository.ShippingOrderRepository; import java.util.Optional; diff --git a/ddd-contexts/shippingcontext/src/main/java/module-info.java b/ddd-contexts/shippingcontext/src/main/java/module-info.java new file mode 100644 index 0000000000..c53cbedf8a --- /dev/null +++ b/ddd-contexts/shippingcontext/src/main/java/module-info.java @@ -0,0 +1,8 @@ +module com.baeldung.dddcontexts.shippingcontext { + requires com.baeldung.dddcontexts.sharedkernel; + exports com.baeldung.dddcontexts.shippingcontext.service; + exports com.baeldung.dddcontexts.shippingcontext.model; + exports com.baeldung.dddcontexts.shippingcontext.repository; + provides com.baeldung.dddcontexts.shippingcontext.service.ShippingService + with com.baeldung.dddcontexts.shippingcontext.service.ParcelShippingService; +} diff --git a/ddd-modules/mainapp/src/main/java/module-info.java b/ddd-modules/mainapp/src/main/java/module-info.java deleted file mode 100644 index 356b03731c..0000000000 --- a/ddd-modules/mainapp/src/main/java/module-info.java +++ /dev/null @@ -1,8 +0,0 @@ -module com.baeldung.dddmodules.mainapp { - uses com.baeldung.dddmodules.sharedkernel.events.EventBus; - uses com.baeldung.dddmodules.ordercontext.service.OrderService; - uses com.baeldung.dddmodules.ordercontext.repository.CustomerOrderRepository; - uses com.baeldung.dddmodules.shippingcontext.repository.ShippingOrderRepository; - uses com.baeldung.dddmodules.shippingcontext.service.ShippingService; - requires transitive com.baeldung.dddmodules.infrastructure; -} \ No newline at end of file diff --git a/ddd-modules/ordercontext/src/main/java/com/baeldung/dddmodules/ordercontext/repository/CustomerOrderRepository.java b/ddd-modules/ordercontext/src/main/java/com/baeldung/dddmodules/ordercontext/repository/CustomerOrderRepository.java deleted file mode 100644 index 771bbf3301..0000000000 --- a/ddd-modules/ordercontext/src/main/java/com/baeldung/dddmodules/ordercontext/repository/CustomerOrderRepository.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.baeldung.dddmodules.ordercontext.repository; - -import com.baeldung.dddmodules.ordercontext.model.CustomerOrder; - -public interface CustomerOrderRepository { - void saveCustomerOrder(CustomerOrder order); -} diff --git a/ddd-modules/ordercontext/src/main/java/com/baeldung/dddmodules/ordercontext/service/OrderService.java b/ddd-modules/ordercontext/src/main/java/com/baeldung/dddmodules/ordercontext/service/OrderService.java deleted file mode 100644 index 1bbb8b8398..0000000000 --- a/ddd-modules/ordercontext/src/main/java/com/baeldung/dddmodules/ordercontext/service/OrderService.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.baeldung.dddmodules.ordercontext.service; - -import com.baeldung.dddmodules.ordercontext.model.CustomerOrder; -import com.baeldung.dddmodules.ordercontext.repository.CustomerOrderRepository; -import com.baeldung.dddmodules.sharedkernel.service.ApplicationService; - -public interface OrderService extends ApplicationService { - void placeOrder(CustomerOrder order); - - void setOrderRepository(CustomerOrderRepository orderRepository); -} diff --git a/ddd-modules/ordercontext/src/main/java/module-info.java b/ddd-modules/ordercontext/src/main/java/module-info.java deleted file mode 100644 index e9b7cf9535..0000000000 --- a/ddd-modules/ordercontext/src/main/java/module-info.java +++ /dev/null @@ -1,8 +0,0 @@ -module com.baeldung.dddmodules.ordercontext { - requires com.baeldung.dddmodules.sharedkernel; - exports com.baeldung.dddmodules.ordercontext.service; - exports com.baeldung.dddmodules.ordercontext.model; - exports com.baeldung.dddmodules.ordercontext.repository; - provides com.baeldung.dddmodules.ordercontext.service.OrderService - with com.baeldung.dddmodules.ordercontext.service.CustomerOrderService; -} \ No newline at end of file diff --git a/ddd-modules/sharedkernel/src/main/java/module-info.java b/ddd-modules/sharedkernel/src/main/java/module-info.java deleted file mode 100644 index aeb64f52c9..0000000000 --- a/ddd-modules/sharedkernel/src/main/java/module-info.java +++ /dev/null @@ -1,4 +0,0 @@ -module com.baeldung.dddmodules.sharedkernel { - exports com.baeldung.dddmodules.sharedkernel.events; - exports com.baeldung.dddmodules.sharedkernel.service; -} diff --git a/ddd-modules/shippingcontext/src/main/java/module-info.java b/ddd-modules/shippingcontext/src/main/java/module-info.java deleted file mode 100644 index a5ec1ca435..0000000000 --- a/ddd-modules/shippingcontext/src/main/java/module-info.java +++ /dev/null @@ -1,8 +0,0 @@ -module com.baeldung.dddmodules.shippingcontext { - requires com.baeldung.dddmodules.sharedkernel; - exports com.baeldung.dddmodules.shippingcontext.service; - exports com.baeldung.dddmodules.shippingcontext.model; - exports com.baeldung.dddmodules.shippingcontext.repository; - provides com.baeldung.dddmodules.shippingcontext.service.ShippingService - with com.baeldung.dddmodules.shippingcontext.service.ParcelShippingService; -}